func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long maxn = 200005;   struct node {     long long ab;     long long cab;   } a[maxn], b[maxn];   struct mon {     long long x, y, z;   } mo[maxn];   bool cmpab(struct node ab1, struct node ab2) { return ab1.ab < ab2.ab; }   bool cmpm(struct mon mo1, struct mon mo2) { return mo1.x < mo2.x; }   struct cmp1 {     bool operator()(const node &a, const node &b) const { return a.ab < b.ab; }   };   long long trb[4 * maxn + 1] = {0}, trbk[4 * maxn + 1] = {0};   void build(long long k, long long l, long long r, long long l1, long long r1,              long long val) {     if (l1 <= l && r <= r1) {       trbk[k] += val;     } else if (!(r < l1 || r1 < l)) {       long long m = (l + r) / 2;       trbk[k * 2 + 2] += trbk[k], trbk[k * 2 + 1] += trbk[k];       trbk[k] = 0;       build(k * 2 + 1, l, m, l1, r1, val);       build(k * 2 + 2, m + 1, r, l1, r1, val);       trb[k] =           max(trb[k * 2 + 1] + trbk[k * 2 + 1], trb[k * 2 + 2] + trbk[k * 2 + 2]);     } else {       return;     }   }   long long cal(long long k, long long l, long long r, long long l1,                 long long r1) {     if (l1 <= l && r <= r1) {       return trb[k] + trbk[k];     } else if (!(r < l1 || r1 < l)) {       long long m = (l + r) / 2;       trbk[k * 2 + 2] += trbk[k], trbk[k * 2 + 1] += trbk[k];       trbk[k] = 0;       trb[k] =           max(trb[k * 2 + 1] + trbk[k * 2 + 1], trb[k * 2 + 2] + trbk[k * 2 + 2]);       long long ans1 = cal(k * 2 + 1, l, m, l1, r1);       long long ans2 = cal(k * 2 + 2, m + 1, r, l1, r1);       return max(ans1, ans2);     } else {       return 0;     }   }   long long bi(long long l, long long r, long long val) {     long long m = (l + r) / 2;     if (l == r) {       return m;     } else if (b[m].ab <= val) {       return bi(m + 1, r, val);     } else {       return bi(l, m, val);     }   }   int main(void) {     long long n, m, p;     scanf( %lld%lld%lld , &n, &m, &p);     for (long long i = 0; i < n; i++) {       scanf( %lld%lld , &a[i].ab, &a[i].cab);     }     for (long long i = 0; i < m; i++) {       scanf( %lld%lld , &b[i].ab, &b[i].cab);     }     for (long long i = 0; i < p; i++) {       scanf( %lld%lld%lld , &mo[i].x, &mo[i].y, &mo[i].z);     }     sort(a, a + n, cmpab);     sort(b, b + m, cmpab);     sort(mo, mo + p, cmpm);     long long ma = -a[0].cab - b[0].cab;     long long monu = 0;     for (long long i = 0; i < m; i++) {       build(0, 0, m - 1, i, i, -b[i].cab);     }     for (long long i = 0; i < n; i++) {       while (a[i].ab > mo[monu].x && monu < p) {         if (mo[monu].y >= b[m - 1].ab) {           monu++;           continue;         }         long long num = bi(0, m - 1, mo[monu].y);         build(0, 0, m - 1, num, m - 1, mo[monu].z);         monu++;       }       ma = max(ma, -a[i].cab + cal(0, 0, m - 1, 0, m - 1));     }     printf( %lld , ma);   }   