func_code_string: #include <bits/stdc++.h>   #pragma GCC optimize( O3 )   #pragma GCC target( sse4 )   using namespace std;   int n, m, k, second;   int a[500005];   int b[500005];   int cnt[500005];   int rbd[500005];   int stat[500005];   int app[500005];   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cin >> m >> k >> n >> second;     for (int i = (1); i <= (signed)(m); i++) {       cin >> a[i];     }     for (int i = (1); i <= (signed)(second); i++) {       int x;       cin >> x;       b[x]++;     }     int rb = 0;     int sat = 0;     for (int i = (1); i <= (signed)(m); i++) {       while (rb <= m && sat < second) {         rb++;         int c = a[rb];         if (b[c] > cnt[c]) {           sat++;         }         cnt[c]++;       }       rbd[i] = max(rb, i + k - 1);       int c = a[i];       if (b[c] >= cnt[c]) sat--;       cnt[c]--;     }     int dc = 0;     for (int i = (1); i <= (signed)(m); i++) {       if (rbd[i] == m + 1) break;       int bef = (i - 1) / k;       int aft = (m - rbd[i]) / k;       if (bef + aft + 1 >= n) {         for (int j = (i); j <= (signed)(rbd[i]); j++) {           int c = a[j];           if (b[c] > app[c]) {             stat[j] = 1;           }           app[c]++;         }         int added = second;         for (int j = (i); j <= (signed)(rbd[i]); j++) {           if (added < k && stat[j] == 0) {             added++;             stat[j] = 1;           } else if (added == k && stat[j] == 0) {             stat[j] = -1;             dc++;           }         }         int td = (i - 1) % k;         if (bef >= n) {           td += (bef + 1 - n) * k;         }         for (int i = (1); i <= (signed)(td); i++) {           stat[i] = -1;           dc++;         }         cout << dc <<   n ;         for (int i = (1); i <= (signed)(m); i++) {           if (stat[i] == -1) cout << i <<    ;         }         return 0;       }     }     cout <<  -1 n ;     return 0;   }   