n, m=map(int, input().split())
matrix = [[0 for _ in range(m)] for _ in range(n)]
count = 1
for k in range(n):
if k:
start = i
else:
start = 0
for i in range(start, m):
line = k
for j in range(i,-1,-1):
if line < n:
matrix[line][j] = count
count += 1
line += 1
break
for q in matrix:
q = str(q)
print(q.rjust(4), end='\n')
(Наконец то тут работает табуляция)
n, m=map(int, input().split())
matrix = [[0 for _ in range(m)] for _ in range(n)]
count = 1
for k in range(n):
if k:
start = i
else:
start = 0
for i in range(start, m):
line = k
for j in range(i,-1,-1):
if line < n:
matrix[line][j] = count
count += 1
line += 1
else:
break
for q in matrix:
q = str(q)
print(q.rjust(4), end='\n')
(Наконец то тут работает табуляция)