func_code_string: #include <bits/stdc++.h>   using namespace std;   inline int read() {     int ans = 0, fh = 1;     char ch = getchar();     while (ch <  0  || ch >  9 ) {       if (ch ==  - ) fh = -1;       ch = getchar();     }     while (ch >=  0  && ch <=  9 )       ans = (ans << 1) + (ans << 3) + ch -  0 , ch = getchar();     return ans * fh;   }   const int maxn = 2e5 + 100;   const long long inf = 1e18;   int n, m, head[maxn], nex[maxn], v[maxn], num = 1;   long long p[maxn << 2], la[maxn << 2];   long long a[maxn], b[maxn], w[maxn];   inline void updata(int o) { p[o] = min(p[o << 1], p[o << 1 | 1]); }   inline void pushdown(int o) {     if (!la[o]) return;     p[o << 1] += la[o], p[o << 1 | 1] += la[o];     la[o << 1] += la[o], la[o << 1 | 1] += la[o];     la[o] = 0;   }   void revise(int o, int l, int r, int ql, int qr, long long qz) {     if (ql == l && qr == r) {       p[o] += qz, la[o] += qz;       return;     }     int mid = l + r >> 1;     pushdown(o);     if (ql <= mid) revise(o << 1, l, mid, ql, min(qr, mid), qz);     if (qr > mid) revise(o << 1 | 1, mid + 1, r, max(ql, mid + 1), qr, qz);     updata(o);   }   long long query(int o, int l, int r, int ql, int qr) {     if (ql == l && qr == r) return p[o];     int mid = l + r >> 1;     pushdown(o);     long long ans = inf;     if (ql <= mid) ans = query(o << 1, l, mid, ql, min(qr, mid));     if (qr > mid)       ans = min(ans, query(o << 1 | 1, mid + 1, r, max(ql, mid + 1), qr));     return ans;   }   void build(int o, int l, int r) {     la[o] = 0;     if (l == r) {       p[o] = b[l];       return;     }     int mid = l + r >> 1;     build(o << 1, l, mid), build(o << 1 | 1, mid + 1, r);     updata(o);   }   inline void add(int x, int y, long long z) {     v[++num] = y;     w[num] = z;     nex[num] = head[x];     head[x] = num;   }   int main() {     n = read(), m = read();     int T = read();     for (int i = 1; i < n; i++) a[i] = read(), b[i] = read();     for (int i = 1; i <= m; i++) {       int x = read(), y = read();       add(x, y, read());     }     build(1, 0, n - 1);     for (int x = 1; x <= n; x++) {       for (int i = head[x]; i; i = nex[i]) revise(1, 0, n - 1, 0, v[i] - 1, w[i]);       b[x] = a[x] + p[1];     }     build(1, 1, n);     printf( %I64d n , p[1]);     while (T--) {       int x = read(), y = read();       revise(1, 1, n, x, x, y - a[x]), a[x] = y;       printf( %I64d n , p[1]);     }     return 0;   }   