#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
int t;
cin>>t;
while(t--)
{
int a,b;
cin>>a>>b;
if(a==1||b==1)
{
cout<<max(a,b)<<"\n";
if(a==1)
{
cout<<"---\n";
}
else
{
cout<<"+\n+\n+\n";
}
continue;
}
if(a!=2&&b!=2) cout<<max(a,b)+(min(a,b)%2==0?min(a,b)/2-1:min(a,b)/2)<<"\n";
else cout<<max(a,b)<<"\n";
if(max(a,b)==b)
{
for(int c=0;c<a;c++)
{
if(c<=a/2||a==2)
{
for(int i=0;i<b;i++)
{
cout<<"-";
}
}
else
{
for(int i=0;i<b;i++)
{
cout<<"+";
}
}
cout<<"\n";
}
}
else
{for(int c=0;c<a;c++)
{
for(int i=0;i<b;i++)
{
if(i<b/2&&b>2)
{
cout<<"-";
}
else
{
cout<<"+";
}
}
cout<<"\n";
}
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Expected integer, but "+" found |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
332 KB |
Expected integer, but "+" found |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
204 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Expected integer, but "+" found |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
21 ms |
1288 KB |
Wrong answer in test 97 21: 107 < 116 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
20 ms |
1300 KB |
Wrong answer in test 24 24: 35 < 44 |
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 |
Expected integer, but "+" found |