Skip to content

Instantly share code, notes, and snippets.

@evjeny
Created October 10, 2017 03:22
Show Gist options
  • Save evjeny/3cf2ad367633a6aaf491a1a9854200cb to your computer and use it in GitHub Desktop.
Save evjeny/3cf2ad367633a6aaf491a1a9854200cb to your computer and use it in GitHub Desktop.
Task1
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