malteklaes/cpp-code-code_search_net-style huggingface dataset:
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     while (t--) {       int a1, b1, c1, ma = 0, maa = 0, x1, y1;       cin >> a1 >> b1 >> c1;       for (int i = 0; i < b1; i++) {         cin >> x1;         ma = max(x1, ma);       }       for (int i = 0; i < c1; i++) {         cin >> y1;         maa = max(y1, maa);       }       if (ma > maa) {         cout <<  YES  << endl;       } else {         cout <<  NO  << endl;       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int dx[] = {1, -1, 0, 0};   int dy[] = {0, 0, 1, -1};   int dddx[] = {1, -1, 0, 0, 1, 1, -1, -1};   int dddy[] = {0, 0, 1, -1, 1, -1, 1, -1};   int t;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cin >> t;     while (t--) {       int n;       cin >> n;       vector<int> vec;       for (int i = 0; i < n; i++) {         int a;         cin >> a;         vec.push_back(a);       }       bool at = false;       for (int i = 0; i < int(vec.size()); i++) {         for (int j = i + 2; j < int(vec.size()); j++) {           if (vec[j] == vec[i]) at = true;         }       }       if (!at)         cout <<  NO               <<   n ;       else         cout <<  YES               <<   n ;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void processTest(int n, int64_t m, int64_t k) {     vector<int64_t> path(n);     int64_t bag = m;     for (auto &v : path) {       cin >> v;     }     for (int i = 1; i < path.size(); ++i) {       auto toEq = max(path[i] - k, int64_t(0));       bag += path[i - 1] - toEq;       if (bag < 0) {         cout <<  NO  << endl;         return;       }     }     cout <<  YES  << endl;   }   int main() {     int t;     cin >> t;     for (int i = 0; i < t; ++i) {       int64_t n, m, k;       cin >> n >> m >> k;       processTest(n, m, k);     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   char str[25];   char times[6] = {4, 5, 6, 3, 2, 1};   int main() {     scanf( %s , str);     int len = strlen(str);     char seat = str[len - 1];     long long rows = 0;     for (int i = 0; i < len - 1; i++) {       rows = rows * 10;       rows += str[i] -  0 ;     }     long long sec;     if (rows % 4 != 0)       sec = rows / 4 * 16;     else       sec = (rows - 1) / 4 * 16;     int tmp = rows % 4;     if (!tmp) tmp = 4;     if (tmp > 2) tmp -= 2;     sec += (tmp - 1) * 7;     sec += times[seat -  a ];     printf( %I64d n , sec);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void solve(int n, int m, vector<int> a) {     for (int i = int(0); i < int(m); i++) a[i] = min(a[i], n / 2);     int sum = accumulate((a).begin(), (a).end(), 0);     if (sum < n) {       cout << -1 << endl;       return;     }     vector<pair<int, int> > b(m);     for (int i = int(0); i < int(m); i++) b[i] = make_pair(a[i], i);     sort((b).begin(), (b).end(), greater<pair<int, int> >());     vector<int> res(n);     for (int i = int(0); i < int(n); i++) {       int j = -1;       if (i == 0)         j = 0;       else if (i == n - 1) {         for (int k = int(0); k < int(m); k++)           if (b[k].second != res[i - 1] && b[k].second != res[0] &&               (j == -1 || b[k].first > b[j].first))             j = k;       } else {         for (int k = int(0); k < int(m); k++)           if (b[k].second != res[i - 1] && (j == -1 || b[k].first > b[j].first))             j = k;       }       res[i] = b[j].second;       b[j].first--;     }     for (int i = int(0); i < int(n); i++)       cout << res[i] + 1 << (i == n - 1 ?   n  :    );   }   int main() {     for (int n, m; cin >> n >> m, n | m;) {       vector<int> a(m);       for (int i = int(0); i < int(m); i++) cin >> a[i];       solve(n, m, a);       break;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   string decToBin(int n) {     string toret;     while (n) {       toret += char((n % 2) +  0 );       n /= 2;     }     while (toret.size() != 8) toret +=  0 ;     return toret;   }   int binToDec(string res) {     int t = 0;     int pow = 1;     for (int i = res.size() - 1; i >= 0; i--) {       t += (res[i] -  0 ) * pow;       pow *= 2;     }     return t;   }   int main() {     string in;     getline(cin, in);     int tmp = 0;     for (int i = 0; i < in.size(); i++) {       int code = (int)in[i];       string p = decToBin(code);       int t = binToDec(p);       int m = tmp - t;       while (m < 0) m += 256;       tmp = t;       cout << m % 256 << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   void BFS(map<int, int> &m1, int t) {     queue<pair<int, int>> q1;     set<int> set_help;     set<int>::iterator p;     q1.push(make_pair(t, 0));     m1[t] = 0;     set_help.insert(t);     int Value, step;     while (q1.empty() == 0) {       Value = q1.front().first;       step = q1.front().second;       if (Value % 2 == 0) {         p = set_help.find(Value / 2);         if (p == set_help.end()) {           m1[Value / 2] = step + 1;           q1.push(make_pair(Value / 2, step + 1));           set_help.insert(Value / 2);         }       }       if (Value % 3 == 0) {         p = set_help.find(Value / 3);         if (p == set_help.end()) {           m1[Value / 3] = step + 1;           q1.push(make_pair(Value / 3, step + 1));           set_help.insert(Value / 3);         }       }       if (Value % 5 == 0) {         p = set_help.find(Value / 5);         if (p == set_help.end()) {           m1[Value / 5] = step + 1;           q1.push(make_pair(Value / 5, step + 1));           set_help.insert(Value / 5);         }       }       q1.pop();     }   }   int main() {     int a, b;     ifstream ff( file.txt );     cin >> a >> b;     if (a == b) {       cout << 0 << endl;       return 0;     }     map<int, int> ma, mb;     BFS(ma, a);     BFS(mb, b);     map<int, int>::iterator p = ma.begin(), p1;     int Stap_Min = INT_MAX, Step;     for (p; p != ma.end(); p++) {       p1 = mb.find(p->first);       if (p1 != mb.end()) {         Step = p->second + p1->second;         if (Step < Stap_Min) {           Stap_Min = Step;         }       }     }     if (Stap_Min == INT_MAX) {       cout << -1 << endl;     } else {       cout << Stap_Min << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int func(int a) {     int cnt = 0;     while (a) {       cnt++;       a /= 10;     }     return cnt;   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     long long n, k;     cin >> n >> k;     vector<long long> v(n);     map<int, int> m[11];     long long ans = 0;     for (int i = 0; i < n; i++) {       cin >> v[i];       long long c = 10;       for (int j = 1; j <= 10; j++) {         m[j][((v[i] % k) * (c % k)) % k]++;         c *= 10;       }     }     for (int i = 0; i < n; i++) {       int a = (k - v[i] % k) % k;       int b = func(v[i]);       ans += m[b][a];       long long c = 1;       for (int j = 0; j < b; j++) {         c *= 10;       }       ans -= a == (v[i] % k * c % k) % k;     }     cout << ans;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n;   int p[300];   int main() {     int i, k, j, l;     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     cin >> n;     for (i = 0; i < 2 * n; i++) {       cin >> p[i];     }     n *= 2;     int result = 200000000;     for (i = 0; i < n; i++) {       for (j = i + 1; j < n; j++) {         vector<int> V;         for (k = 0; k < n; k++) {           if (k != i && k != j) {             V.push_back(p[k]);           }         }         sort(V.begin(), V.end());         int sum = 0;         for (l = 0; l < V.size(); l = l + 2) {           sum += (V[l + 1] - V[l]);         }         result = min(result, sum);       }     }     cout << result << endl;     return 0;   }
#include <bits/stdc++.h>   int main() {     int x, y, z;     scanf( %d %d %d , &x, &y, &z);     if (x > y + z) {       printf( + n );     } else if (y > x + z) {       printf( - n );     } else if (x == y && z == 0) {       printf( 0 n );     } else {       printf( ? n );     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int n, m, k, cnt;   int main() {     scanf( %d%d%d , &n, &m, &k);     if (4 * n * m - 2 * n - 2 * m < k) {       puts( NO );       return 0;     }     puts( YES );     if (m == 1) {       if (k <= n - 1) {         puts( 1 );         printf( %d D n , k);       } else {         puts( 2 );         printf( %d D n , n - 1);         printf( %d U n , k - n + 1);       }       return 0;     }     int kk = k, x = 1;     while (k && x < n) {       cnt++;       if (k <= 3 * (m - 1)) {         if (k % 3 && k > 3) cnt++;         break;       }       k -= 3 * (m - 1);       cnt++;       if (k <= m - 1) break;       k -= m - 1;       cnt++;       if (k <= 1) break;       k--;       x++;     }     if (k && x == n) {       cnt++;       if (k > m - 1) cnt++;       if (k > 2 * (m - 1)) cnt++;     }     printf( %d n , cnt);     k = kk, x = 1;     while (k && x < n) {       if (k <= 3 * (m - 1)) {         if (k >= 3) printf( %d RDU n , k / 3);         if (k % 3 >= 1) printf( 1 R );         if (k % 3 >= 2) printf( D );         puts(  );         break;       }       printf( %d RDU n , m - 1);       k -= 3 * (m - 1);       if (k <= m - 1) {         printf( %d L n , k);         break;       }       printf( %d L n , m - 1);       k -= m - 1;       if (k <= 1) {         printf( 1 D n );         break;       }       printf( 1 D n );       k--;       x++;     }     if (k && x == n) {       if (k <= m - 1)         printf( %d R n , k);       else {         printf( %d R n , m - 1);         k -= m - 1;         if (k <= m - 1)           printf( %d L n , k);         else {           printf( %d L n , m - 1);           k -= m - 1;           printf( %d U n , k);         }       }     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int ar[] = {2, 7, 2, 3, 3, 4, 2, 5, 1, 2};   int main() {     int n, a, sum = 1;     cin >> n;     for (int i = 0; i < 2; i++) {       a = n % 10;       sum *= ar[a];       n /= 10;     }     cout << sum << endl;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     srand(time(NULL));     ios_base::sync_with_stdio(false);     cin.tie(NULL);     cout.setf(ios::fixed);     cout.precision(0);     long long n;     cin >> n;     string s;     char y =  a ;     while (n != 0) {       s.push_back(y);       int t = 1;       while (t <= n) {         s.push_back(y);         n -= t;         t++;       }       y++;     }     if (s.size() == 0) s.push_back( a );     cout << s;   }
#include <bits/stdc++.h>   using namespace std;   inline int ckmax(int &a, int b) { return a < b ? a = b, 1 : 0; }   inline int ckmin(int &a, int b) { return a > b ? a = b, 1 : 0; }   char s[500100], t[500100];   int n, m, wt, p[500100], sta[500100], pre[500100], nex[500100], top;   int main() {     scanf( %d%d%d , &n, &m, &wt);     scanf( %s , s + 1);     scanf( %s , t + 1);     for (int i = 1; i <= n; ++i) {       if (s[i] ==  ( )         sta[++top] = i;       else {         p[i] = sta[top];         p[sta[top--]] = i;       }       pre[i] = i - 1;       nex[i] = i + 1;     }     nex[0] = 1;     pre[n + 1] = n;     for (int i = 1; i <= m; ++i) {       if (t[i] ==  L )         wt = pre[wt];       else if (t[i] ==  R )         wt = nex[wt];       else {         int ww = p[wt];         if (ww > wt) swap(ww, wt);         nex[pre[ww]] = nex[wt];         pre[nex[wt]] = pre[ww];         if (nex[wt] <= n)           wt = nex[wt];         else           wt = pre[ww];       }     }     int w = nex[0];     while (w <= n) {       printf( %c , s[w]);       w = nex[w];     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int t;     cin >> t;     while (t--) {       int n;       cin >> n;       int a[n];       map<int, int> mp;       for (int i = 0; i < n; i++) {         cin >> a[i];         mp[a[i]]++;       }       int mx = 0, p = 0;       for (auto it = mp.begin(); it != mp.end(); it++) {         mx = max(mx, it->second);         p++;       }       cout << max(min(mx, p - 1), min(mx - 1, p)) << endl;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     int n, k;     cin >> n >> k;     deque<int> dq;     map<int, int> freq;     for (int i = 0; i < n; i++) {       int x;       cin >> x;       if (freq[x] == 0) {         if ((int)dq.size() < k)           dq.push_front(x);         else {           dq.push_front(x);           freq[dq.back()] = 0;           dq.pop_back();         }         freq[x] = 1;       }     }     cout << (int)dq.size() <<   n ;     for (auto i : dq) cout << i <<    ;     cout <<   n ;     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const long long maxx = 1e6 + 7;   const long long maxn = 1e6 + 7;   const long long mod = 998244353;   const long long maxs = 500000 + 7;   const long long maxm = 400000 + 7;   const long long maxk = 1008 + 7;   const long long maxw = 100 + 7;   const long long maxh = 100 + 7;   const double pi = 3.1415926;   const long long ten = 10;   const long long ooi = 1000000;   const long long ool = 1e18 + 7;   const long double eps = 1e-8;   const int apsz = 26;   int seq[maxn];   int n;   void init() {     cin >> n;     for (long long i = (1); i <= (n); i++) {       cin >> seq[i];     }     sort(seq + 1, seq + 1 + n);   }   void solve() {     int ans = 0;     int i = 1;     int nowd = 1;     while (i <= n) {       while (i <= n && seq[i] < nowd) i++;       if (i == n + 1) break;       ans++;       nowd++, i++;     }     cout << ans << endl;   }   int main(void) {     ios::sync_with_stdio(false);     cout.tie(0);     cin.tie(0);     init();     solve();     return 0;   }
#include <bits/stdc++.h>   const int mn = 10100, mm = 5010000;   char st[mm], ans[mm];   int f[mm], s[mm], L[mn], R[mn];   int n, m, K, i, j, d, len, now;   void del(int p) {     for (; p <= m; p += p & (-p)) --s[p];   }   int query(int v) {     int i = 1, l = m >> 1;     for (; l; l >>= 1)       if (s[i + l - 1] < v) v -= s[i + l - 1], i += l;     return i;   }   int main() {     scanf( %s , st + 1);     scanf( %d , &K);     for (m = 1; m < K; m <<= 1)       ;     scanf( %d , &n);     for (i = 1; i <= n; ++i) scanf( %d%d , L + i, R + i);     for (i = 1; i <= m; ++i) s[i] = i & (-i);     for (i = n; i >= 1; --i) {       if (R[i] >= s[m]) continue;       len = R[i] - L[i] + 1, now = L[i] + 1;       for (j = 1; j <= len; ++j) {         if (R[i] >= s[m]) break;         if (now > R[i]) now = L[i];         d = query(R[i] + 1), del(d);         f[d] = query(now);         now += 2;       }     }     j = 1;     for (i = 1; i <= K; ++i) ans[i] = f[i] ? ans[f[i]] : st[j++];     puts(ans + 1);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 1e5 + 7;   const int INF = 1e8;   void boost() {     cin.tie(0);     cout.tie(0);     ios_base::sync_with_stdio(NULL);   }   long long n, a[N], b[N], sum, sum2, ans, dp[N], t;   string s;   int main() {     boost();     cin >> t;     for (int l = 1; l <= t; ++l) {       cin >> n;       sum = 0;       ans = 0;       for (int i = 1; i <= n; ++i) {         cin >> a[i];       }       for (int i = 1; i <= n; ++i) {         sum += a[i];         if (sum <= 0) {           cout <<  NO  <<   n ;           ans = 1;           break;         }       }       sum = 0;       for (int i = n; i >= 1; --i) {         sum += a[i];         if (sum <= 0 && ans == 0) {           cout <<  NO  <<   n ;           ans = 1;           break;         }       }       if (!ans) {         cout <<  YES  <<   n ;       }     }   }
#include <bits/stdc++.h>   using namespace std;   const double PI = 3.1415926535897932384626433;   int MOD = 0;   int pl(int v1, int v2) {     int res = v1 + v2;     if (res < 0)       res += MOD;     else if (res >= MOD)       res -= MOD;     return res;   }   int mul(const int v1, const int v2) { return (int)((1LL * v1 * v2) % MOD); }   const int N = 250007;   vector<int> fac(N);   void initFac() {     fac[1] = 1;     for (int i = 2; i < N; i++) {       fac[i] = mul(fac[i - 1], i);     }   }   void solve() {     int n;     cin >> n;     ;     cin >> MOD;     if (n == 1) {       cout << 1 << endl;       return;     }     initFac();     int ans = mul(fac[n], n);     ans = pl(ans, fac[n]);     for (int len = 2; len < n; len++) {       int lans = n - len + 1;       lans = mul(lans, fac[len]);       lans = mul(lans, n - len + 1);       lans = mul(lans, fac[n - len]);       ans = pl(ans, lans);     }     cout << ans << endl;   }   int main() {     cin.tie(nullptr);     std::ios::sync_with_stdio(false);     solve();   }
#include <bits/stdc++.h>   #pragma warning(disable : 4996)   using namespace std;   vector<int> get_sb(int num) {     vector<int> res;     while (num) {       res.push_back(num % 10);       num /= 10;     }     return res;   }   string get_a(vector<int> kol, string sub) {     string reserve =  9 ;     ++reserve[0];     if (sub[0] ==  0 ) return reserve;     string ss =   ;     for (int i = 0; i < kol.size(); ++i) {       for (int j = 0; j < kol[i]; ++j) ss += (char)(i +  0 );     }     return sub + ss;   }   string get_b(vector<int> kol, string sub) {     string res =   ;     string reserve =  9 ;     ++reserve[0];     int mc = -1;     for (int i = 1; i < kol.size(); ++i) {       if (0 != kol[i]) {         mc = i;         break;       }     }     if (-1 == mc) return reserve;     int cci = sub[0] -  0 ;     res += (char)(mc +  0 );     --kol[mc];     for (int i = 0; i < cci; ++i) {       for (int j = 0; j < kol[i]; ++j) res += (char)(i +  0 );     }     res += sub;     for (int i = cci; i < kol.size(); ++i) {       for (int j = 0; j < kol[i]; ++j) res += (char)(i +  0 );     }     return res;   }   string get_c(vector<int> kol, string sub) {     string res =   ;     string reserve =  9 ;     ++reserve[0];     int mc = -1;     for (int i = 1; i < kol.size(); ++i) {       if (0 != kol[i]) {         mc = i;         break;       }     }     if (-1 == mc) return reserve;     int cci = sub[0] -  0 ;     res += (char)(mc +  0 );     --kol[mc];     for (int i = 0; i <= cci; ++i) {       for (int j = 0; j < kol[i]; ++j) res += (char)(i +  0 );     }     res += sub;     for (int i = cci + 1; i < kol.size(); ++i) {       for (int j = 0; j < kol[i]; ++j) res += (char)(i +  0 );     }     return res;   }   int main() {     string num, sub;     getline(cin, num);     getline(cin, sub);     if (num ==  01  || num ==  10 ) {       printf( 0 );       return 0;     }     int len_all = (int)num.size();     bool flag = true;     for (int i = 1; i < sub.size(); ++i) {       if (sub[i - 1] < sub[i]) {         flag = false;         break;       }     }     vector<int> kol(10);     for (int i = 0; i < num.size(); ++i) ++kol[num[i] -  0 ];     for (int i = 0; i < sub.size(); ++i) --kol[sub[i] -  0 ];     for (int aa = 1; aa <= 1000000; ++aa) {       bool flag = true;       vector<int> vv = get_sb(aa);       vector<int> kol1 = kol;       for (int i = 0; i < vv.size(); ++i) {         --kol1[vv[i]];         if (kol1[vv[i]] < 0) {           flag = false;           break;         }       }       if (!flag) continue;       int vsz = (int)vv.size();       if (len_all - vsz != aa) continue;       string a = get_a(kol1, sub);       string b = get_b(kol1, sub);       string c = get_c(kol1, sub);       string ans = min(a, b);       ans = min(ans, c);       cout << ans;       break;     }     return 0;   }
#include <bits/stdc++.h>   using namespace std;   int main() {     ios::sync_with_stdio(false);     int n, k;     cin >> n >> k;     int t[n];     for (int i = 0; i < n; i++) cin >> t[i];     sort(t, t + n);     if (k == n)       cout << t[n - 1] << endl;     else if (k == 0) {       if (t[0] - 1 == 0)         cout << -1 << endl;       else         cout << t[0] - 1 << endl;     } else if (k == 1) {       if (t[0] == t[1])         cout << -1 << endl;       else         cout << t[0] << endl;     } else if (t[k - 1] == t[k])       cout << -1 << endl;     else       cout << t[k - 1] << endl;   }
#include <bits/stdc++.h>   using namespace std;   int absol(int x);   int main() {     int n, C, left, right, top, bot;     char c;     int xy[10][2] = {{1, 3}, {0, 0}, {1, 0}, {2, 0}, {0, 1},                      {1, 1}, {2, 1}, {0, 2}, {1, 2}, {2, 2}};     cin >> n;     cin >> c;     C = c;     C -= 48;     left = C;     right = C;     top = C;     bot = C;     for (int i = 1; i < n; i++) {       cin >> c;       C = c;       C -= 48;       if (xy[C][0] < xy[left][0])         left = C;       else if (xy[C][0] > xy[right][0])         right = C;       if (xy[C][1] < xy[top][1])         top = C;       else if (xy[C][1] > xy[bot][1] || (bot != 0 && (C == 7 || C == 9)))         bot = C;     }     if ((absol(xy[bot][1] - xy[top][1]) == 2 &&          absol(xy[right][0] - xy[left][0]) == 2 && bot != 8 && bot != 0) ||         absol(xy[bot][1] - xy[top][1]) == 3) {       cout <<  YES  << endl;     } else       cout <<  NO  << endl;     return 0;   }   int absol(int x) {     if (x < 0)       return x * -1;     else       return x;   }
#include <bits/stdc++.h>   int const MAX = 1e5 + 5;   using namespace std;   bool check(long long m, long long ai, long long di, long long hm, long long am,              long long dm) {     long long retval;     if (hm % (ai - dm) == 0)       retval = m - (((hm) / (ai - dm))) * (am - (di));     else       retval = m - (1 + ((hm) / (ai - dm))) * (am - (di));     if (retval > 0) return true;     return false;   }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long hy, hm, ay, am, dy, dm;     cin >> hy >> ay >> dy >> hm >> am >> dm;     long long h, a, d;     cin >> h >> a >> d;     long long ans = LLONG_MAX;     for (long long i = 0; i < 1000; i++) {       for (long long j = 0; j < 1000; j++) {         long long ai = ay + i;         long long di = dy + j;         long long c = a * i + d * j;         if (ai <= dm) continue;         long long l = 0, r = 10000;         while (r - l > 1) {           long long mid = (l + r) >> 1;           if (check(hy + mid, ai, di, hm, am, dm))             r = mid;           else             l = mid;         }         if (!check(hy + l, ai, di, hm, am, dm)) l++;         if (l < 0) l = 0;         c += l * h;         ans = min(ans, c);       }     }     cout << ans;   }
#include <bits/stdc++.h>   using namespace std;   void solve(long long int input) {     long long int n;     cin >> n;     double a[n], b[n];     for (long long int i = 0; i < n; i++) cin >> a[i];     for (long long int i = 0; i < n; i++) cin >> b[i];     map<long double, long long int> mp;     long long int ans = 0;     long long int j = 0;     for (long long int i = 0; i < n; i++) {       if (a[i] == 0 && b[i] == 0) {         j++;         continue;       }       if (a[i] == 0) continue;       mp[(b[i] / (a[i]))]++;       ans = max(ans, mp[(b[i] / (a[i]))]);     }     cout << ans + j <<   n ;   }   signed main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout.tie(0);     long long int x = 1;     for (long long int i = 1; i <= x; i++) solve(i);     return 0;   }
#include <bits/stdc++.h>   using namespace std;   const int N = 200005;   int n, a, b, k, pr[N], seq[N];   char s[200005];   int main() {     scanf( %d%d%d%d , &n, &a, &b, &k);     scanf( %s , s + 1);     int len = strlen(s + 1), lst = 0, cur = 0;     for (int i = 1; i <= len; ++i) {       if (s[i] ==  1 ) {         cur += (i - lst - 1) / b;         lst = i;       }     }     if (s[len] !=  1 ) cur += (len - lst) / b;     int ans = 0, now = 0, da = 0;     for (int i = 1; i <= len; ++i) {       now++;       if (s[i] ==  1 ) now = 0;       if (now == b) {         now = 0;         ans++;         seq[ans] = i;         if (cur - ans < a) break;       }     }     printf( %d n , ans);     for (int i = 1; i <= ans; ++i) printf( %d  , seq[i]);     return 0;   }