aboutsummaryrefslogtreecommitdiff
path: root/AlmostTernaryMatrix/main.cpp
blob: b12f97404578eaa221ca65f9b25937e8d67404b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include<bits/stdc++.h>

using namespace std;

int main () {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int tt;
	cin >> tt;
	while(tt--){
    int n, m;
    cin >> n >> m;
    for(int i = 0; i < n; i++) {
      for(int j = 0; j < m; j++) {
        cout << ((((i + 1) / 2 + (j + 1) / 2)) % 2) << " ";
      }
      cout << '\n';
    }
	}
}