func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     long n, k, a;     cin >> n >> k >> a;     long n_moves;     cin >> n_moves;     set<pair<long, long> > s;     s.insert(make_pair(n, 1));     long max_ships = (n + 1) / (a + 1);     for (int i = 1; i <= n_moves; i++) {       long x;       cin >> x;       set<pair<long, long> >::iterator it = s.lower_bound(make_pair(x, -1));       long l = it->second;       long r = it->first;       max_ships -= (r - l + 2) / (a + 1);       if ((x - 1) >= l) {         max_ships += ((x - 1) - l + 2) / (a + 1);       }       if ((x + 1) <= r) {         max_ships += (r - (x + 1) + 2) / (a + 1);       }       if (max_ships < k) {         cout << i;         return 0;       }       s.erase(it);       if ((x - 1) >= l) s.insert(make_pair(x - 1, l));       if ((x + 1) <= r) s.insert(make_pair(r, x + 1));     }     cout <<  -1 ;     return 0;   }   