#include <bits/stdc++.h>
using namespace std;
int main() {
cin.tie(nullptr)->sync_with_stdio(false);
int t;
cin >> t;
while (t--) {
int n, m;
cin >> n >> m;
if (m <= n - 2) {
cout << "Yes\n";
vector G(n, vector<bool>(n));
for (int i = 2; i < 2 + m; i++)
G[0][i] = true, G[1][i] = false;
for (int i = 1; i < n; i++) {
for (int j = 0; j < i; j++)
cout << (G[j][i] ? '1' : '0');
cout << "\n";
}
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |