Все задачи на 5.10.17 13:00

This commit is contained in:
2017-10-05 13:08:02 +03:00
parent 93746b05d7
commit ca2ca71f63
120 changed files with 2343 additions and 0 deletions

10
uts/session_py/C.py Normal file
View File

@@ -0,0 +1,10 @@
w, h, xo, yo, x, y = map(int, input().split())
l = abs(x-xo)+abs(y-yo)
ll = yo + abs(h-y) + abs(x-xo)
lll = h-yo+y+abs(x-xo)
llll = xo+abs(w-x)+abs(y-yo)
lllll = w-xo+x+abs(y-yo)
llllll = xo+yo+abs(h-y)+abs(w-x)
lllllll = abs(h-yo)+abs(w-xo)+x+y
print(min(l,ll,lll,llll,lllll,llllll,lllllll))