#include <bits/stdc++.h>
using namespace std;
int a,b,c,d,t;
int main(){
cin>>t;
while(t--){
cin>>a>>b;
if(a < 3 or b < 3) cout<<max(a, b)<<endl << "*" << endl;
if(a >= 3 and b >= 3){
if(a == b) cout<<a + b - 2;
else{
if(max(a, b) % min(a, b) == 0) cout<<max(a, b) - (max(a, b) - min(a, b));
else cout<<max(a, b) - (max(a, b) - min(a, b)) + 1;
}
cout<<endl;
for(int i=1; i <= (a / 2); i++){
for(int j=1; j <= b; j++){
if(j <= ((b / 2) + 1)) cout<<"+";
else cout<<"-";
}
cout<<endl;
}
for(int i=1; i <= 1; i++){
for(int j=1; j <= b; j++){
if(j == ((b / 2) + 1)) cout<<"+";
else cout<<"-";
}
}
cout<<endl;
for(int i=1; i <= (a / 2); i++){
for(int j=1; j <= b; j++){
if(j >= ((b / 2) + 1)) cout<<"+";
else cout<<"-";
}
cout<<endl;
}
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
348 KB |
in the table A+B is not equal to 3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
42 ms |
1516 KB |
in the table A+B is not equal to 22 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
32 ms |
1420 KB |
in the table A+B is not equal to 46 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Wrong answer |
2 |
Halted |
0 ms |
0 KB |
- |