Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- mas = [[0 for i in range(2 * n - 1)] for i in range(n)]
- start = (2 * n - 1) // 2
- lst = []
- for i in range(n):
- lst = list(map(int, input().split()))
- size = len(lst)
- ind = 0
- for j in range(start, start + size):
- mas[i][j] = lst[ind]
- ind += 1
- start -= 1
- typ = input()
- count = 0
- count_need = 1
- need_str = 1
- if typ == "counterclockwise":
- for j in range(2 * n - 1 - 1, -1, -1):
- for i in range(n):
- if count != count_need:
- if mas[i][j] != 0:
- print(mas[i][j], end = " ")
- count += 1
- else:
- print()
- count = 0
- need_str += 1
- count_need= need_str * 2 - 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement