#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define mod 1000000007
#define sp << " " <<
#define endl << '\n'
/*
row -> +
col -> -
*/
long long int row, col;
void solve(){
cin >> row >> col;
if (row > col){
cout << row + (col - 1) / 2;
}else{
cout << col + (row - 1) / 2;
}
cout endl;
for (int i = 0; i < row; i++){
for (int o = 0; o < col; o++){
if (row > col){
if (o <= (col - 1) / 2){
cout << "+";
}else{
cout << "-";
}
}else{
if (i <= (row - 1) / 2){
cout << "-";
}else{
cout << "+";
}
}
}
cout endl;
}
cout endl;
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long int Q;
cin >> Q;
while (Q--){
solve();
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |