-
Notifications
You must be signed in to change notification settings - Fork 0
/
A.cpp
38 lines (33 loc) · 876 Bytes
/
A.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<int> vi;
#define INF 1000000000
#define mod 1000000007
int m,n, nb, arr[100][100]{0};
void solve() {
cin >> n >> m;
for (int i = 0; i <n; ++i)
for (int j = 0; j < m; ++j)
if (i == 0 && j == 0) arr[i][j] = 0;
else if (j == 0) arr[i][j] = arr[i-1][j]^1;
else arr[i][j] = arr[i][j-1]^1;
if (n % 2 ==0 || m % 2 == 0) arr[0][1] = 0;
for (int i = 0; i < n; ++i) {
for (int j = 0; j < m; ++j)
if (arr[i][j]) cout << "W";
else cout << "B";
cout << "\n";
}
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--)
solve();
return 0;
}