제출 #1134120

#제출 시각아이디문제언어결과실행 시간메모리
1134120hamzabcRed-blue table (IZhO19_stones)C++20
0 / 100
13 ms1348 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...