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