aboutsummaryrefslogtreecommitdiff
path: root/teleport.py
diff options
context:
space:
mode:
Diffstat (limited to 'teleport.py')
-rw-r--r--teleport.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/teleport.py b/teleport.py
new file mode 100644
index 0000000..17c1fa2
--- /dev/null
+++ b/teleport.py
@@ -0,0 +1,8 @@
+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)) \ No newline at end of file