Skip to content

Instantly share code, notes, and snippets.

@IKKO-Ohta
Last active April 30, 2017 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IKKO-Ohta/a9394c8915b96bc711ca908825cab559 to your computer and use it in GitHub Desktop.
Save IKKO-Ohta/a9394c8915b96bc711ca908825cab559 to your computer and use it in GitHub Desktop.
ABC60[B],Choose Integers
from fractions import gcd
nums = [int(x) for x in input().split()]
def ngcd(nums):
d = 0
for num in nums:
d = gcd(d,num)
return d
t = ngcd(nums)
if t != 1:
nums = [int(num / t) for num in nums]
t = gcd(nums[0],nums[1])
if t == 1:
print('YES')
else:
print('NO')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment