Skip to content

Instantly share code, notes, and snippets.

@modos
Created October 4, 2022 03:17
Show Gist options
  • Save modos/7d4ce0349da8aee6b1f7a0f411e462c9 to your computer and use it in GitHub Desktop.
Save modos/7d4ce0349da8aee6b1f7a0f411e462c9 to your computer and use it in GitHub Desktop.
بدخواه پویان
p, d = [int(i) for i in input().split()]
x = 1
while True:
if 0 <= (x * d) % p <= p / 2:
print(x * d)
break
x += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment