func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 500010;   int m, k, n, s, a[maxn], b[maxn], c[maxn], maxx, tong[maxn], ansl, ansr,       vis[maxn];   bool check(int l, int r) {     memcpy(c, tong, sizeof(c));     for (int i = l; i <= r; i++) c[a[i]]--;     for (int i = 1; i <= maxx; i++)       if (c[i] > 0) {         return false;       }     return true;   }   void gen(int l, int r) {     int temp = l - (min(n - 1, (l - 1) / k) * k + 1);     temp += max(0, r - l + 1 - k);     if (temp <= m - n * k) {       printf( %d n , temp);       int num = 0;       for (int i = min(n - 1, (l - 1) / k) * k + 1; i < l; i++) {         printf( %d  , i);         num++;       }       int num2 = 0;       memset(c, 0, sizeof(c));       for (int i = l; i <= r; i++)         if (c[a[i]] + 1 <= tong[a[i]]) {           vis[i] = 1;           c[a[i]]++;           num2++;         }       num2 = r - l + 1 - num2;       num += num2;       for (int i = l; i <= r; i++)         if (!vis[i] && num > temp) {           num--;           vis[i] = 1;         }       for (int i = l; i <= r; i++)         if (!vis[i]) printf( %d  , i);       exit(0);     }   }   void solve(int x) {     memset(c, 0, sizeof(c));     int cur = m;     for (int i = x; i <= m; i++) c[a[i]]++;     for (int i = x - 1; i >= 1; i--) {       c[a[i]]++;       while (cur > i) {         if (c[a[cur]] - 1 >= tong[a[cur]] &&             c[a[cur - 1]] + 1 >= tong[a[cur - 1]]) {           c[a[cur]]--;           cur--;         } else           break;       }       gen(i, cur);     }   }   int main() {     scanf( %d%d%d%d , &m, &k, &n, &s);     for (int i = 1; i <= m; i++) scanf( %d , &a[i]);     for (int i = 1; i <= s; i++) {       scanf( %d , &b[i]);       maxx = max(maxx, b[i]);       tong[b[i]]++;     }     int l = 1, r = m, res = 0;     while (l <= r) {       int mid = (l + r) >> 1;       if (check(mid, m)) {         res = mid;         l = mid + 1;       } else         r = mid - 1;     }     if (res) {       gen(res, m);       solve(res);       puts( -1 );     } else       puts( -1 );     return 0;   }   