kilonova/61/solutie.cpp

24 lines
369 B
C++

#include <iostream>
using namespace std;
int main() {
int n, k, offset=0;
cin >> n >> k;
for (int i = 0; i < n; i++) {
for (int j = 0; j < offset; j++) {
cout << "1";
}
for (int j = 0; j < n-k; j++) {
if (offset + j < n) {
cout << "0";
}
}
for (int j = 0; j < k-offset; j++) {
cout << "1";
}
cout << endl;
offset++;
}
return 0;
}