func_code_string: #include <bits/stdc++.h>   using namespace std;   const int mm = 500050;   int n, ss, tt, kk, m;   int c[1001001], v[1001001];   int g[1001001];   int xx[1001001], yy[1001001], minvv = 0, initi = 0;   long long sum[500500], ti[500500];   vector<int> num[500500];   inline void solve() {     int i = 0;     while (i <= m) {       if (initi - ti[i] <= tt) break;       initi -= ti[i];       minvv += mm;       ++i;     }     memset(xx, 0, sizeof(xx));     int j = 0;     while (j < num[i].size()) {       int vv = num[i][j];       ++xx[1];       --xx[vv + 1];       ++j;     }     int now = i;     i = 1;     while (i <= mm) {       xx[i] += xx[i - 1];       ++i;     }     i = 1;     while (i <= mm) {       ++minvv;       if (initi - xx[i] - sum[now] <= tt) break;       initi -= xx[i] + sum[now];       ++i;     }   }   int main() {     scanf( %d%d%d%d , &n, &kk, &ss, &tt);     int i = 1;     while (i <= n) {       scanf( %d%d , &c[i], &v[i]);       ++i;     }     g[0] = 0;     i = 1;     while (i <= kk) {       scanf( %d , &g[i]);       ++i;     }     g[kk + 1] = ss;     ++kk;     sort(g + 1, g + kk + 1);     i = 1;     while (i <= kk) {       minvv = max(minvv, g[i] - g[i - 1]);       ++i;     }     i = 1;     while (i <= kk) {       int x = minvv - (g[i] - g[i - 1]), y = 2 * (g[i] - g[i - 1]) - minvv;       if (y <= 0) {         initi += g[i] - g[i - 1];       } else {         initi += x + 2 * y;         num[y / mm].push_back(y % mm);         ti[y / mm] += y % mm;         ;       }       ++i;     }     m = 2000000000 / mm;     sum[m + 1] = 0;     i = m;     while (i >= 0) {       sum[i] = sum[i + 1] + num[i + 1].size();       ti[i] += 1ll * sum[i] * mm;       --i;     }     if (initi > tt) solve();     int ans = 2000000000;     i = 1;     while (i <= n) {       if (v[i] >= minvv) ans = min(ans, c[i]);       ++i;     }     if (ans == 2000000000) ans = -1;     printf( %d n , ans);     return 0;   }   