Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- const int MAXN = 5e5 + 5;
- int n, k, l;
- bool sol2[MAXN];
- int main(){
- cin >> n >> k >> l;
- cout << (long long)k * l / n + bool(((long long)k * l) % n) << '\n';
- for(int i = 0; i < n; i++) cout << bool(i < k);
- cout << '\n';
- int pos = 0;
- for(int i = 0; i < l; i++){
- if(sol2[pos]){
- pos++;
- pos %= n;
- }
- sol2[pos] = true;
- pos += k;
- pos %= n;
- }
- for(int i = 0; i < n; i++) cout << sol2[i];
- return 0;
- }
Add Comment
Please, Sign In to add comment