Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f = open("input.txt", "r")
- z = open("output.txt", "w+")
- F = f.read()
- A, N = map(int, F.split())
- B = 0
- с = 0
- for B in range(10**9):
- if (A * B + A + B) % N == 0:
- с = 1
- break
- if c != 1:
- B = -1
- z.write(str(B))
- f.close()
- z.close()
Add Comment
Please, Sign In to add comment