-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path682C.cpp
More file actions
38 lines (36 loc) · 839 Bytes
/
682C.cpp
File metadata and controls
38 lines (36 loc) · 839 Bytes
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;
int main()
{
int t;
scanf("%d", &t);
while (t--)
{
int n , m;
scanf("%d %d", &n, &m);
int arr[n][m];
for (int i = 0; i < n; i++)
{
for(int j = 0; j < m; j++){
scanf("%d", &arr[i][j]);
if((i+j)%2==1){
if(arr[i][j]%2==0){
arr[i][j]++;
}
}
else if((i+j)%2==0){
if(arr[i][j]%2==1){
arr[i][j]++;
}
}
}
}
for (int i = 0; i < n; i++)
{
for(int j = 0; j < m; j++){
printf("%d ",arr[i][j]);
}
printf("\n");
}
}
}