func_code_string: #include <bits/stdc++.h>   using namespace std;   int read() {     int x = 0, f = 1;     char ch = getchar();     while (!isdigit(ch)) f = ch ==  -  ? -1 : f, ch = getchar();     while (isdigit(ch)) x = x * 10 + ch -  0 , ch = getchar();     return x * f;   }   const int N = 200050;   int sta[3][N], f[3][N], F[3];   int n, m, s, e;   int pos[N];   void dp() {     for (int t = 0; t < 3; t++)       for (int i = sta[t][0] - 1; i >= 1; i--)         f[t][i] = f[t][i + 1] + max(sta[t][i + 1] - sta[t][i] - s, 0);   }   int binary_search(int t, int x) {     int ret, l = 1, r = sta[t][0], mid;     while (l <= r) {       mid = l + r >> 1;       if (sta[t][mid] >= x)         ret = mid, r = mid - 1;       else         l = mid + 1;     }     return ret;   }   int main() {     pos[0] = e = read(), s = read(), n = read(), m = read();     for (int i = 0; i < 3; i++) sta[i][++sta[i][0]] = pos[0];     for (int i = 1, tp; i <= n; i++) {       tp = read(), pos[i] = read();       if (pos[i] >= e) continue;       switch (tp) {         case 3:           sta[2][++sta[2][0]] = pos[i];         case 2:           sta[1][++sta[1][0]] = pos[i];         case 1:           sta[0][++sta[0][0]] = pos[i];       }     }     sort(sta[0] + 1, sta[0] + sta[0][0] + 1),         sort(sta[1] + 1, sta[1] + sta[1][0] + 1),         sort(sta[2] + 1, sta[2] + sta[2][0] + 1);     dp();     for (int i = 1, x; i <= m; i++) {       x = read();       for (int t = 0; t < 3; t++) {         int y = binary_search(t, x);         F[t] = f[t][y] + max(sta[t][y] - x - s, 0);       }       if (F[0] > 0)         printf( -1 -1 n );       else         printf( %d %d n , F[1], F[2] - F[1]);     }     return 0;   }   