Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.72 KB | None | 0 0
  1. A = int(input()) #длина
  2. B = int(input()) #ширина
  3. C = int(input()) #длина пути
  4. if C > (A+B)*2:
  5.     if C % ((A+B)*2) < A and C % ((A+B)*2) > 0:
  6.         print("BOTTOM")
  7.     elif C % ((A+B)*2) > 0 and C % ((A+B)*2) > A and C % ((A+B)*2) < A+B:
  8.         print("RIGHT")
  9.     elif C % ((A+B)*2) > 0 and C % ((A+B)*2) > A+B and C % ((A+B)*2) < A*2+B:
  10.         print("TOP")
  11.     elif C % ((A+B)*2) > 0 and C % ((A+B)*2) > A*2+B and C % ((A+B)*2) < ((A+B)*2):
  12.         print("LEFT")
  13. elif C < (A+B) * 2:
  14.     if (C > 0 and C < A):
  15.         print("BOTTOM")
  16.     if (C > A and C < A+B):
  17.         print("RIGHT")
  18.     if (C > A+B and C < A*2+B):
  19.         print("TOP")
  20.     if (C > A*2+B and C < (A+B)*2):
  21.         print("LEFT")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement