Skip to content

Commit 7624597

Browse files
June 2020
1 parent dfa13a0 commit 7624597

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Codechef/June 2020/eve_matrix.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# cook your dish here
2+
for _ in range(int(input())):
3+
n=int(input())
4+
c=1
5+
for i in range(n):
6+
for j in range(n):
7+
if i%2==0:
8+
print(c,end=' ')
9+
c+=1
10+
else:
11+
print(c+n-j-1,end=' ')
12+
else:
13+
if i%2!=0:
14+
c+=n
15+
print()

0 commit comments

Comments
 (0)