A1104 Sum of Number Segments [连续子序列分割]
#include<iostream>
#include<cstdio>
using namespace std;
int main() {
int n;
cin >> n;
long double val, sum = 0.0;
for (int i = 1; i <= n; i++) {
cin >> val;
sum += val * (n - i + 1) * i;
}
printf("%.2lf", sum);
return 0;
}