func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, k, a, ans;   set<pair<int, int> > s;   int x, m;   bool used[1000000];   int solve(int x) { return (x + 1) / (a + 1); }   void go(int x) {     set<pair<int, int> >::iterator it = s.upper_bound(make_pair(x, 1000000000));     --it;     pair<int, int> cur = *it;     s.erase(it);     ans -= solve(cur.second - cur.first + 1);     if (x != cur.first) {       ans += solve(x - cur.first);       s.insert(make_pair(cur.first, x - 1));     }     if (x != cur.second) {       ans += solve(cur.second - x);       s.insert(make_pair(x + 1, cur.second));     }   }   int main() {     cin >> n >> k >> a;     s.insert(make_pair(1, n));     ans = solve(n);     cin >> m;     for (int i = 1; i <= m; i++) {       cin >> x;       if (used[x]) continue;       used[x] = 1;       go(x);       if (ans < k) {         cout << i;         return 0;       }     }     cout << -1;   }   