-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday11.py
36 lines (26 loc) · 819 Bytes
/
day11.py
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
#!/bin/python3
import math
import os
import random
import re
import sys
if __name__ == '__main__':
arr = []
max = -999
count = 0
for _ in range(6):
arr.append(list(map(int, input().rstrip().split())))
for x in range(1,5):
for y in range(1,5):
top_x = x-1
bottom_x = x+1
left_y = y-1
center_y = y
right_y = y+1
sum = arr[top_x][left_y] + arr[top_x][center_y] + arr[top_x][right_y] + arr[bottom_x][left_y] + arr[bottom_x][center_y] + arr[bottom_x][right_y] + arr[x][y]
# print(str(x) + "," + str(y))
# print(str(count) + ": " + str(sum) )
# count += 1
if sum > max:
max = sum
print(max)