if arr[시][도] > arr[시][경] + arr[경][도]
arr[시][도] = arr[시][경] + arr[경][도]
inf = int(21e8)
arr = [[0,5,inf,8],
[7,0,9,inf],
[2,inf,0,4],
[inf,inf,3,0]
]
for k in range(4): # k는 경유지
for i in range(4): # i는 시작점
for j in range(4): # j는 도착점
if arr[i][j] > arr[i][k] + arr[k][j]:
arr[i][j] = arr[i][k] + arr[k][j]
for m in range(4):
for n in range(4):
print(arr[m][n],end = ' ')
print()