#include <iostream>
#include <cstring>
using namespace std;
void solve(int n, int m)
{
cout << (m + (n-1)/2) << '\n';
for(int i = 0; i < n; ++i)
cout << (i <= n/2 ? string(m, '-') : string(m, '+')) << '\n';
}
void solve2(int n, int m)
{
cout << (n + (m-1)/2) << '\n';
for(int i = 0; i < n; ++i)
cout << string(m/2 + 1, '+') << string((m-1)/2, '-') << '\n';
}
int main()
{
int t, n, m;
cin >> t;
while(t--)
{
cin >> n >> m;
if(n < m) solve(n, m);
else solve2(n, m);
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
288 KB |
Output is correct |
2 |
Correct |
1 ms |
296 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
288 KB |
Output is correct |
2 |
Correct |
1 ms |
296 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
2 ms |
332 KB |
Wrong answer in test 5 29: 31 < 32 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
1228 KB |
Wrong answer in test 97 21: 107 < 116 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
1228 KB |
Wrong answer in test 24 24: 35 < 44 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
288 KB |
Output is correct |
2 |
Correct |
1 ms |
296 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Incorrect |
2 ms |
332 KB |
Wrong answer in test 5 29: 31 < 32 |