#include using namespace std; #define int long long int n; int a[200005]; signed main() { ios_base::sync_with_stdio(0); cin.tie(nullptr); cin >> n; for(int i = 1; i <= n; i++) { cin >> a[i]; } int res = 0; for(int i = 1; i <= n; i++) { res += a[i] * (n - i + 1) * i; } cout << res; return 0; }