func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long MAXN = 1e6 + 5;   const long long MAXM = 4e7 + 5;   const int MOD = 998244353;   long long n, m, p;   struct node1 {     long long x, c;   } a[MAXN], b[MAXN];   struct node2 {     long long x, y, z;   } c[MAXN];   struct node {     long long l, r, val, mark;   } t[MAXN << 2];   void build(long long rt, long long l, long long r) {     t[rt].l = l, t[rt].r = r;     t[rt].mark = 0;     if (l == r) {       t[rt].val = -b[l].c;       return;     }     long long mid = (t[rt].l + t[rt].r) >> 1;     build(rt << 1, l, mid);     build(rt << 1 | 1, mid + 1, r);     t[rt].val = max(t[rt << 1].val, t[rt << 1 | 1].val);   }   void spread(long long rt) {     t[rt << 1].val += t[rt].mark;     t[rt << 1 | 1].val += t[rt].mark;     t[rt << 1].mark += t[rt].mark;     t[rt << 1 | 1].mark += t[rt].mark;     t[rt].mark = 0;   }   void update(long long rt, long long l, long long r, long long val) {     if (l > r) return;     if (t[rt].l >= l && t[rt].r <= r) {       t[rt].val += val;       t[rt].mark += val;       return;     }     spread(rt);     long long mid = (t[rt].l + t[rt].r) >> 1;     if (l <= mid) update(rt << 1, l, r, val);     if (r > mid) update(rt << 1 | 1, l, r, val);     t[rt].val = max(t[rt << 1].val, t[rt << 1 | 1].val);   }   bool cmp(node1 a, node1 b) { return a.x < b.x; }   bool cmp1(node2 a, node2 b) { return a.x < b.x; }   long long q[MAXN];   int main() {     while (~scanf( %I64d%I64d%I64d , &n, &m, &p)) {       for (long long i = 1; i <= n; i++) scanf( %I64d%I64d , &a[i].x, &a[i].c);       for (long long i = 1; i <= m; i++) scanf( %I64d%I64d , &b[i].x, &b[i].c);       sort(a + 1, a + n + 1, cmp);       sort(b + 1, b + m + 1, cmp);       for (long long i = 1; i <= m; i++) q[i] = b[i].x;       build(1, 1, m);       for (long long i = 1; i <= p; i++) {         scanf( %I64d%I64d%I64d , &c[i].x, &c[i].y, &c[i].z);       }       sort(c + 1, c + p + 1, cmp1);       long long pos = 1;       long long ans = -1ll << 62;       for (long long i = 1; i <= n; i++) {         while (pos <= p && c[pos].x < a[i].x) {           long long pp = upper_bound(q + 1, q + m + 1, c[pos].y) - q;           update(1, pp, m, c[pos].z);           pos++;         }         ans = max(ans, (long long)t[1].val - a[i].c);       }       printf( %I64d n , ans);     }   }   