#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
void solve(){
int n, m;
cin >> n >> m;
if(n<m){
cout << max(n, m) << endl;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
cout << "-";
}
cout << "\n";
}
}
else if(n>m){
cout << max(n, m) << endl;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
cout << "+";
}
cout << "\n";
}
}
else{
cout << n+floor(n/2) << endl;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
if(j<ceil(m/2)){
cout << "-";
}
else{
cout << "+";
}
}
cout << "\n";
}
}
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while(t--){
solve();
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
in the table A+B is not equal to 3 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
204 KB |
Wrong answer in test 3 45: 45 < 46 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
in the table A+B is not equal to 3 |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
23 ms |
1284 KB |
Wrong answer in test 97 21: 97 < 116 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
26 ms |
1276 KB |
in the table A+B is not equal to 36 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
in the table A+B is not equal to 3 |