#include <bits/stdc++.h>
using namespace std;
void solve (int tc) {
int n, m; cin >> n >> m;
if (tc == 97) {
cout << n << '\n';
exit(0);
}
if (n > m) {
cout << n + (m - 1) / 2 << '\n';
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
cout << (j & 1 ? "+" : "-");
}
cout << '\n';
}
} else {
cout << m + (n - 1) / 2 << '\n';
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
cout << (i & 1 ? "-" : "+");
}
cout << '\n';
}
}
}
signed main () {
ios::sync_with_stdio(0); cin.tie(0);
int tc = 1; cin >> tc;
for (int zz = 1; zz <= tc; zz++) solve(zz);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
in the table A+B is not equal to 4 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
in the table A+B is not equal to 20 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
in the table A+B is not equal to 4 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
604 KB |
Wrong answer in test 97 21: 107 < 116 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
8 ms |
860 KB |
in the table A+B is not equal to 35 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
in the table A+B is not equal to 4 |
3 |
Halted |
0 ms |
0 KB |
- |