#include <algorithm>
#include <iostream>
using namespace std;
int main() {
int t, n, m;
cin >> t;
while (t--) {
cin >> n >> m;
if (n >= m) {
cout << n + (m - 1) / 2 << endl;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if ((m - 1) / 2 < j) {
cout << "- ";
} else {
cout << "+ ";
}
}
cout << endl;
}
} else {
cout << m + (n - 1) / 2 << endl;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if ((n - 1) / 2 < i) {
cout << "+ ";
} else {
cout << "- ";
}
}
cout << endl;
}
}
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
364 KB |
Wrong answer |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
85 ms |
2352 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
64 ms |
2284 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |