def gcd if return else return gcd map int input split gcd print int in

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
a, b = map(int, input().split())
k = gcd(a, b)
print(int(a/k), int(b/k))
def gcd(a, b):
if b == 0:
return a
else:
return gcd(b, a % b)
a, b, c, d = map(int, input().split())
k = gcd(c-a, d-b)
print(abs(k)+1)