func_code_string: #include <bits/stdc++.h>   unsigned long long u64;   using namespace std;   int n, m, qr;   long long c[2 * 200000], cnt[2 * 200000];   void lazy_update(int v, int i, int j, int qi, int qj, long long x) {     if (qi > j || qj < i) return;     if (qi <= i && j <= qj) {       c[v] += (x + i - qi), ++cnt[v];       return;     }     int k = (i + j) / 2;     lazy_update(2 * v, i, k, qi, qj, x),         lazy_update(2 * v + 1, k + 1, j, qi, qj, x);   }   long long query(int v, int i, int j, int pos) {     if (pos < i || pos > j) return 0;     if (i == j) {       assert(pos == i);       return c[v];     }     int k = (i + j) / 2;     if (c[v] > 0) {       c[2 * v] += c[v], cnt[2 * v] += cnt[v];       c[2 * v + 1] += (c[v] + cnt[v] * (k + 1 - i)), cnt[2 * v + 1] += cnt[v];       c[v] = cnt[v] = 0;     }     return max(query(2 * v, i, k, pos), query(2 * v + 1, k + 1, j, pos));   }   int main() {     int i, j, k, l, r;     long long x;     while (cin >> n >> m >> qr) {       memset(c, 0, sizeof(c));       memset(cnt, 0, sizeof(cnt));       while (m--) {         cin >> l >> r >> x;         lazy_update(1, 1, n, l, r, x);       }       long long ax = 0;       while (qr--) {         cin >> i;         ax += query(1, 1, n, i);       }       cout << ax << endl;     }     return 0;   }   