T = 10
for t in range(1, T+1):
lst = []
_ = int(input())
for i in range(100):
lst.append(list(map(int, input().split())))
max = 0
for i in range(100):
max += lst[0][i]
for i in range(100):
total = 0
for j in range(100):
total += lst[i][j]
if max < total:
max = total
for j in range(100):
total = 0
for i in range(100):
total += lst[i][j]
if max < total:
max = total
total = 0
for i in range(100):
total += lst[i][i]
if max < total:
max = total
total = 0
for i in range(100):
total += lst[99 - i][i]
if max < total:
max = total
print('#{} {}'.format(t, max))
'알고리즘 문제 풀이 > SWEA' 카테고리의 다른 글
[SWEA 1210 python] Ladder1 (0) | 2021.08.13 |
---|---|
[SWEA 2001 python] 파리 퇴치 (0) | 2021.08.13 |
[SWEA 1954 python] 달팽이 숫자 (0) | 2021.08.13 |
[SWEA 1945 python] 간단한 소인수분해 (0) | 2021.08.13 |
[SWEA 1208 python] Flatten (0) | 2021.08.13 |