Created
November 27, 2021 18:18
-
-
Save FirePing32/814b30e589db03de30361846146db18f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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