#include #include #include #include #include #include #include #include #include #include #include #include typedef unsigned long long ULLONG; typedef long long LLONG; static const LLONG MOD_NUM = 1000000007; template static void getval(_T& a) { std::cin >> a; } template static void getval(_T& a, _T& b) { std::cin >> a >> b; } template static void getval(_T& a, _T& b, _T& c) { std::cin >> a >> b >> c; } template static _T tp_abs(_T a) { if (a < (_T)0) { a *= (_T)-1; } return a; } template static void tp_swap(_T& right, _T& left) { // usage: tp_swap(a, b); _T tmp = right; right = left; left = tmp; } static void exec(); int main() { exec(); fflush(stdout); return 0; } static void exec() { int N; getval(N); std::vector ai(N); for (int i = 0; i < N; i++) { getval(ai[i]); } LLONG ans = 0; for (int i = 0; i < N; i++) { LLONG cnt = i + 1; ans += ai[i] * (LLONG)(N - i) * cnt; } printf("%lld\n", ans); }