Skip to content

Instantly share code, notes, and snippets.

@FirePing32
Created November 27, 2021 18:18
Show Gist options
  • Save FirePing32/814b30e589db03de30361846146db18f to your computer and use it in GitHub Desktop.
Save FirePing32/814b30e589db03de30361846146db18f to your computer and use it in GitHub Desktop.
ans = []
def func():
for _ in range(int(input())):
data = [int(x) for x in input().split()]
n = 1
def test():
nonlocal n
if (n * data[1]) % data[0] == 0:
ans.append(n)
else:
n += 1
test()
test()
for x in ans:
print(x)
func()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment