#include<bits/stdc++.h>
using namespace std;
int main()
{
int t , i , j , m , n , ans;
cin >> t;
while(t > 0)
{
cin >> n >> m;
ans = max(n , m) + (min(n , m) - 1) / 2;
cout << ans << endl;
if(n > m)
{
for(i = 0 ; i < n ; i++)
{
for(j = 0 ; j < m - ((m - 1) / 2) ; j++)
{
cout << '+';
}
for(j = 0 ; j < (m - 1) / 2 ; j++)
{
cout << '-';
}
cout << endl;
}
}
else
{
for(i = 0 ; i < n - ((n - 1) / 2) ; i++)
{
for(j = 0 ; j < m ; j++)
{
cout << '-';
}
cout << endl;
}
for(i = 0 ; i < (n - 1) / 2 ; i++)
{
for(j = 0 ; j < m ; j++)
{
cout << '+';
}
cout << endl;
}
}
t--;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
14 ms |
376 KB |
Output is correct |
4 |
Incorrect |
23 ms |
376 KB |
Wrong answer in test 5 29: 31 < 32 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
93 ms |
1400 KB |
Wrong answer in test 97 21: 107 < 116 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
67 ms |
1272 KB |
Wrong answer in test 24 24: 35 < 44 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
376 KB |
Output is correct |
3 |
Correct |
14 ms |
376 KB |
Output is correct |
4 |
Incorrect |
23 ms |
376 KB |
Wrong answer in test 5 29: 31 < 32 |