#include <bits/stdc++.h>
using namespace std;
void solve(){
int a,b,i,j;
cin >> a >> b;
cout << max(a,b) + (min(a,b)/2) << endl;
if(a < b){
for(i = 1;i <= (a+1)/2;i++){
for(j = 1;j <= b;j++){
cout << '-';
}
cout << endl;
}
for(i = 1;i <= (a-1)/2;i++){
for(j = 1;j <= b;j++){
cout << '-';
}
cout << endl;
}
}
else{
for(i = 1;i <= a;i++){
for(j = 1;j <= (b+1)/2;j++){
cout << '+';
}
for(j = 1;j <= (b-1)/2;j++){
cout << '-';
}
cout << endl;
}
}
}
int main() {
int t;
cin >> t;
while(t--){
solve();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
292 KB |
Wrong answer |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
5 ms |
312 KB |
in the table A+B is not equal to 46 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
292 KB |
Wrong answer |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
56 ms |
1208 KB |
Wrong answer in test 97 21: 107 < 116 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
44 ms |
1204 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
292 KB |
Wrong answer |
3 |
Halted |
0 ms |
0 KB |
- |