#include <bits/stdc++.h>
using namespace std;
int t, n, m;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin >> t;
for(int ti = 1; ti <= t; ++ti) {
cin >> n >> m;
if(n == 1) {
cout << m << "\n";
for(int i = 1; i <= m; ++i) {
cout << "-";
}
cout << "\n";
} else if(m == 1) {
cout << n << "\n";
for(int i = 1; i <= n; ++i) {
cout << "+";
cout << "\n";
}
} else {
int ns = (n - 1) / 2 * 2, ms = (m - 1) / 2 * 2;
cout << ns + ms << "\n";
for(int i = 1; i <= n; ++i) {
for(int j = 1; j <= m; ++j) {
if(i > ns) {
cout << "+";
} else if(j > ms) {
cout << "-";
} else {
cout << (((i + j) & 1) ? "-" : "+");
}
}
cout << "\n";
}
}
}
cout << flush;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
in the table A+B is not equal to 4 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
in the table A+B is not equal to 46 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
in the table A+B is not equal to 4 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
37 ms |
1388 KB |
in the table A+B is not equal to 116 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
41 ms |
1516 KB |
in the table A+B is not equal to 44 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
in the table A+B is not equal to 4 |
2 |
Halted |
0 ms |
0 KB |
- |