Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = int(input())
- b = int(input())
- c = int(input())
- d = int(input())
- i = 0
- def nod(n,m):
- while (n != 0) and (m != 0):
- if n > m:
- n = n % m
- else:
- m = m % n
- return(n + m)
- while a < c and b < d:
- a += 1
- b += 1
- i += 1
- if a == c and b == d:
- break
- a = a / nod(a,b)
- b = b / nod(a,b)
Add Comment
Please, Sign In to add comment