#include #define int long long const int maxn = 2e5 + 5; const int inf = 1e18; const int base = 31; const int mod = 1e9 + 7; const int mod2 = 1212121; using namespace std; int n; int res = 0; signed main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cin >> n; for(int i = 1; i <= n; i++) { int x; cin >> x; res += x * (n - i + 1) * i; } cout << res << "\n"; }