- Notifications
You must be signed in to change notification settings - Fork 519
Expand file tree
/
Copy pathHourglass
More file actions
Latest commit
25 lines (18 loc) · 550 Bytes
/
Copy pathHourglass
File metadata and controls
25 lines (18 loc) · 550 Bytes
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
#!/bin/python3
importmath
importos
importrandom
importre
importsys
if__name__=='__main__':
arr= []
for_inrange(6):
arr.append(list(map(int, input().rstrip().split())))
maximum=-9*7
foriinrange(6):
forjinrange(6):
ifj+2<6andi+2<6:
result=arr[i][j] +arr[i][j+1] +arr[i][j+2] +arr[i+1][j+1] +arr[i+2][j] +arr[i+2][j+1] +arr[i+2][j+2]
ifresult>maximum:
maximum=result
print(maximum)