func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long Mod = 1e9 + 7;   const long long INF = (long long)(1e18) + 5;   const long long N = 2e5 + 5, M = 18;   int n, m, p;   int a[N];   tuple<long long, long long, long long> b[N];   long long suf_s[N], suf_c[N];   long long dp[N], prev_dp[N];   void solve(int i, int j, int l, int r) {     if (j < i) return;     int mid = i + j >> 1;     long long best = INF, idx = -1;     long long cnt = 0, sum = 0;     if (mid < l) {       sum += suf_s[mid] - suf_s[l];       cnt += suf_c[mid] - suf_c[l];     }     for (int k = max(mid, l); k <= r; k++) {       auto [t, c, s] = b[k];       sum += s;       cnt += c;       long long cur = sum + cnt * t + prev_dp[k + 1];       if (cur < best) best = cur, idx = k;     }     dp[mid] = best;     solve(i, mid - 1, l, idx);     solve(mid + 1, j, idx, r);   }   int main() {     ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);     cin >> n >> m >> p;     for (int i = 1; i < n; i++) cin >> a[i], a[i] += a[i - 1];     map<long long, long long> cnt, sum;     long long ans2 = 0;     for (int i = 0; i < m; i++) {       int h, t;       cin >> h >> t;       h--;       cnt[t - a[h]]++;       sum[t - a[h]] += a[h] - t;     }     m = 0;     for (auto [i, j] : cnt) b[m++] = {i, j, sum[i]};     for (int i = m; i >= 0; i--) {       auto [t, c, s] = b[i];       suf_s[i] = s + suf_s[i + 1];       suf_c[i] = c + suf_c[i + 1];     }     for (int i = 0; i < m; i++) dp[i] = INF;     while (p--) {       swap(dp, prev_dp);       solve(0, m - 1, 0, m - 1);     }     cout << dp[0] <<   n ;     return 0;   }   