Created
October 10, 2017 14:10
-
-
Save evjeny/df2a4ed5ed1539209d1719a2a45b412d to your computer and use it in GitHub Desktop.
Task1.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def abs(k): | |
if k>=0: | |
return k | |
else: | |
return -k | |
def dist(ax,ay,bx,by): | |
if ax == bx: | |
return abs(ay-by) | |
elif ay==by: | |
return abs(ax-bx) | |
return ((ax-bx)**2+(ay-by)**2)**0.5 | |
ax,ay = [int(i) for i in input().split()] | |
bx,by = [int(i) for i in input().split()] | |
a = abs(ax-bx) | |
b = abs(ay-by) | |
mn = min(a,b) | |
mx = max(a,b) | |
sqs = mn | |
print(sqs+(mx-mn)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment