#include <iostream>
#include <algorithm>
#include <math.h>
//#include <vector>
//#include <stack>
//#include <queue>
//#include <map>
//#include <set>
//#include <deque>
#define ll long long
#define sz(s) (int)s.size()
#define N 200005
#define ff first
#define ss second
using namespace std;
int T, n, m;
char c[1005][1005];
int main()
{
cin >> T;
while(T--){
cin >> n >> m;
if(n == 1 and m == 1){
cout << 1 << '\n';
}
else {
cout << n+m-2 << '\n';
}
for(int i = 1; i <= n; i += 2){
for(int j = 1; j <= m; j++){
if(j % 2 == 1) c[i][j] = '+';
else c[i][j] = '-';
}
}
for(int i = 2; i <= n; i += 2){
for(int j = 1; j <= m; j++){
if(j % 2 == 1) c[i][j] = '-';
else c[i][j] = '+';
}
}
for(int i = 1; i <= m; i++){
c[n][i] = '-';
}
for(int i = 1; i <= n; i++){
c[i][n] = '+';
}
for(int i = 1; i <= n; i++){
for(int j = 1; j <= m; j++){
cout << c[i][j];
}
cout << '\n';
}
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
600 KB |
Wrong answer in test 1 3: 2 < 3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Wrong answer in test 2 1: 1 < 2 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
600 KB |
Wrong answer in test 1 3: 2 < 3 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
23 ms |
1344 KB |
in the table A+B is not equal to 116 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
22 ms |
1372 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 |
600 KB |
Wrong answer in test 1 3: 2 < 3 |
2 |
Halted |
0 ms |
0 KB |
- |