← Back to List

25333번: 개구리 ↗

Solutions

Python 3
147 B | 147 chars
def gcd(a, b):
  return gcd(b, a % b) if b > 0 else a

for i in range(int(input())):
  a, b, x = map(int, input().split())
  print(x // gcd(a, b))