This repository has been archived on 2022-01-12. You can view files and clone it, but cannot push or open issues or pull requests.
USACO-Demo/teleport.py
2020-08-08 21:15:47 -05:00

8 lines
248 B
Python

with open("teleport.in", "r") as fin:
l = list(fin)[0].split()
a,b,x,y = int(l[0]), int(l[1]), int(l[2]), int(l[3])
ans = min(abs(b-a), abs(x-a)+abs(b-y), abs(y-a)+abs(b-x))
with open("teleport.out", 'w') as fout:
fout.write(str(ans))