#include <bits/stdc++.h>
using namespace std;
int t, n, m, ans;
signed main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
cin >> t;
while (t--) {
cin >> n >> m;
if (n > m) {
ans = n + (m-1)/2;
cout << ans << "\n";
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (j <= m/2) cout << '+';
else cout << '-';
}
cout << "\n";
}
}
else {
ans = m + (n-1)/2;
cout << ans << "\n";
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (i <= n/2) cout << '-';
else cout << '+';
}
cout << "\n";
}
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3054 ms |
189664 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
3051 ms |
191412 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |