#45020: python


moyao0907349805@gmail.com (阿維)

學校 : 不指定學校
編號 : 273912
來源 : [27.247.193.237]
最後登入時間 :
2025-04-10 12:53:11
i428. 1. 巴士站牌 -- 2022年10月APCS | From: [27.247.164.177] | 發表日期 : 2025-01-02 19:40

n=int(input())
station=[list(map(int, input().split())) for _ in range(n)] # n個車站
lx,ly=station[0] # 先記錄第一個車站
max_rout=0
min_rout=10000
for x,y in station[1:]: # 從第二個車站開始
    rout=abs(lx-x)+abs(ly-y)
    min_rout=min(min_rout, rout)
    max_rout=max(max_rout, rout)
    lx,ly=x,y
print(f'{max_rout} {min_rout}')
 
ZeroJudge Forum