func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long MOD = 1e9 + 7;   const int N = 2e5 + 5;   const int SZ = 1e6 + 5;   const long long INF = 2e9 + 5;   int n, m, p;   pair<int, long long> a[N], b[N];   pair<int, pair<int, long long> > mon[N];   long long tree[4 * SZ], lazy[4 * SZ], cost[SZ];   void Build(int c, int ss, int se) {     if (ss == se) {       tree[c] = cost[ss];       return;     }     int mid = (ss + se) >> 1;     Build(c << 1, ss, mid);     Build(c << 1 | 1, mid + 1, se);     tree[c] = max(tree[c << 1], tree[c << 1 | 1]);   }   void Push(int c, int ss, int se) {     if (lazy[c]) {       tree[c] += lazy[c];       if (ss != se) {         lazy[c << 1] += lazy[c];         lazy[c << 1 | 1] += lazy[c];       }       lazy[c] = 0;     }   }   void Set(int c, int ss, int se, int qs, int qe, long long val) {     Push(c, ss, se);     if (ss > se || qs > se || qe < ss) return;     if (qs <= ss && se <= qe) {       lazy[c] += val;       Push(c, ss, se);       return;     }     int mid = (ss + se) >> 1;     Set(c << 1, ss, mid, qs, qe, val);     Set(c << 1 | 1, mid + 1, se, qs, qe, val);     tree[c] = max(tree[c << 1], tree[c << 1 | 1]);   }   long long Get(int c, int ss, int se, int qs, int qe) {     Push(c, ss, se);     if (ss > se || qs > se || qe < ss) return -INF;     if (qs <= ss && se <= qe) return tree[c];     int mid = (ss + se) >> 1;     return max(Get(c << 1, ss, mid, qs, qe),                Get(c << 1 | 1, mid + 1, se, qs, qe));   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     cin >> n >> m >> p;     for (int i = 1; i <= n; i++) cin >> a[i].first >> a[i].second;     for (int i = 1; i <= m; i++) cin >> b[i].first >> b[i].second;     for (int i = 1; i <= p; i++)       cin >> mon[i].first >> mon[i].second.first >> mon[i].second.second;     for (int i = 1; i < SZ; i++) cost[i] = -INF;     for (int i = 1; i <= m; i++) {       cost[b[i].first] = max(cost[b[i].first], -b[i].second);     }     sort(a + 1, a + 1 + n);     sort(mon + 1, mon + 1 + p);     Build(1, 1, SZ - 1);     int j = 0;     long long ans = -2 * INF;     for (int i = 1; i <= n; i++) {       while (j + 1 <= p && a[i].first > mon[j + 1].first) {         j++;         Set(1, 1, SZ - 1, mon[j].second.first + 1, SZ, mon[j].second.second);       }       ans = max(ans, -a[i].second + Get(1, 1, SZ - 1, 1, SZ - 1));     }     cout << ans;     return 0;   }   