func_code_string: #include <bits/stdc++.h>   using namespace std;   bool sortbysec(pair<int, string> a, pair<int, string> b) {     if (a.first != b.first)       return a.first > b.first;     else       return a.second < b.second;   }   int binarySearch(vector<int> a, int n, int key) {     int low = 0;     int high = n, mid;     while (low <= high) {       mid = (low + high) / 2;       if (a[mid] <= key) {         low = mid + 1;       } else if (a[mid] > key) {         high = mid - 1;       }     }     if (high - low == 1) {       if (a[low] >= key)         return low;       else         return high;     } else       return mid;   }   vector<int> SieveOfEratosthenes(int n) {     vector<int> prime(n + 1, 1);     for (int p = 2; p * p <= n; p++) {       if (prime[p] == 1) {         for (int i = p * p; i <= n; i += p) prime[i] = 0;       }     }     return prime;   }   vector<pair<long long, long long>> v;   void primeFactors(long long n) {     v.clear();     long long k = 0;     while (n % 2 == 0) {       k++;       n = n / 2;     }     if (k != 0) v.push_back({2, k});     for (long long i = 3; i <= sqrt(n); i = i + 2) {       k = 0;       while (n % i == 0) {         k++;         n = n / i;       }       if (k != 0) v.push_back({i, k});     }     if (n > 2) v.push_back({n, 1});   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     int t = 1;     while (t--) {       long long n;       cin >> n;       long long ans = n;       long long a[n];       for (int i = 0; i < n; i++) {         cin >> a[i];         ans += (i + 1) * (a[i] - 1);       }       cout << ans;     }   }   