Advertisement
serega1112

otrezok

Jan 7th, 2021
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1.  
  2. x1, y1, x2, y2 = map(int, input().split())
  3.  
  4.  
  5. x = abs(x2 - x1)
  6. y = abs(y2 - y1)
  7.  
  8. if x == 0 or y == 0:
  9.     print(max(x, y) + 1)
  10. else:
  11.     a, b = x, y
  12.     while a % b > 0:
  13.         a, b = b, a % b
  14.     print(b + 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement