func_code_string: #include <bits/stdc++.h>   using namespace std;   inline long long mul(long long x, long long y) {     if (x >= (1ll << 60) / y)       return (1ll << 60);     else       return x * y;   }   int n, m, p;   int d[100005];   long long cat[100005], sum[100005];   long long dp[105][100005];   int dq[100005], s, e;   int main() {     scanf( %d%d%d , &n, &m, &p);     for (int i = 2; i <= n; ++i) scanf( %d , d + i), d[i] += d[i - 1];     for (int i = 1; i <= m; ++i) {       int h, t;       scanf( %d%d , &h, &t);       cat[i] = t - d[h] + 1000000000;     }     sort(cat + 1, cat + 1 + m);     for (int i = 1; i <= m; ++i) sum[i] = sum[i - 1] + cat[i];     memset(dp, 63, sizeof(dp));     for (int i = 0; i < 105; ++i) dp[i][0] = 0;     for (int k = 1; k <= p; ++k) {       dq[0] = 0, s = 0, e = 1;       for (int i = 1; i <= m; ++i) {         long long c1 = cat[i], c2 = i * c1 - sum[i];         while (s + 1 < e) {           long long x1 = dq[s], y1 = dp[k - 1][x1] + sum[x1];           long long x2 = dq[s + 1], y2 = dp[k - 1][x2] + sum[x2];           if ((y2 - y1) <= mul(c1, (x2 - x1)))             s++;           else             break;         }         int t = dq[s];         dp[k][i] = min(dp[k][i], dp[k - 1][t] + sum[t] - c1 * t + c2);         while (s + 1 < e) {           long long x1 = i, y1 = dp[k - 1][i] + sum[i];           long long x2 = dq[e - 1], y2 = dp[k - 1][x2] + sum[x2];           long long x3 = dq[e - 2], y3 = dp[k - 1][x3] + sum[x3];           if (mul((y1 - y2), (x2 - x3)) <= mul((y2 - y3), (x1 - x2)))             e--;           else             break;         }         dq[e++] = i;       }     }     printf( %I64d n , dp[p][m]);   }   