import numpy as np
사각형 = 5
탐색가능지역 = 3
지뢰밭 = [[1, 0, 0, 1, 0],
[0, 1, 0, 0, 1],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 0],
[0, 0, 1, 0, 0]]
s = 0
for i in range(사각형 - 탐색가능지역 + 1):
for j in range(탐색가능지역):
if np.sum(지뢰밭[i:탐색가능지역+i, j:탐색가능지역+j]) > s:
s = np.sum(지뢰밭[i:탐색가능지역+i, j:탐색가능지역+j])
print(s)