func_code_string: #include <bits/stdc++.h>   using std::cin;   using std::cout;   using std::deque;   using std::endl;   using std::map;   using std::max;   using std::min;   using std::multiset;   using std::pair;   using std::queue;   using std::set;   using std::sort;   using std::stack;   using std::string;   using std::vector;   int n, k, s, t;   int c[200005] = {       0,   };   int v[200005] = {       0,   };   int g[200005] = {       0,   };   bool isGood(int middle) {     int time = 0;     for (int i = 1; i <= k + 1; i++) {       int len = g[i] - g[i - 1];       if (len > middle) {         return false;       }       if (middle >= len * 2) {         time += len;       } else {         time += (len * 2 - middle) * 2 + (middle - len);       }     }     if (time <= t) return true;     return false;   }   int main() {     cin >> n >> k >> s >> t;     for (int i = 0; i < n; i++) {       scanf( %d%d , c + i, v + i);     }     g[0] = 0;     g[k + 1] = s;     for (int i = 1; i <= k; i++) {       scanf( %d , g + i);     }     sort(g, g + k + 2);     const int up = 2123456789;     int badBak = 0;     int goodBak = up;     while (badBak + 1 != goodBak) {       int middle = (int)((1LL * badBak + goodBak) / 2);       if (isGood(middle)) {         goodBak = middle;       } else {         badBak = middle;       }     }     if (goodBak == up) {       cout << -1;       return 0;     }     int cheap = up;     for (int i = 0; i < n; i++) {       if (v[i] >= goodBak && c[i] < cheap) {         cheap = c[i];       }     }     if (cheap == up) {       cout << -1;       return 0;     }     cout << cheap;     return 0;   }   