Problem:


Score : 200 points

Problem Statement

We ask you to select some number of positive integers, and calculate the sum of them.

It is allowed to select as many integers as you like, and as large integers as you wish.
You have to follow these, however: each selected integer needs to be a multiple of A, and you need to select at least one integer.

Your objective is to make the sum congruent to C modulo B.
Determine whether this is possible.

If the objective is achievable, print YES. Otherwise, print NO.

Constraints

1 ≤ A ≤ 100

1 ≤ B ≤ 100

0 ≤ C < B

Input

Input is given from Standard Input in the following format:

A B C

Output

Print YES or NO.

Sample Input 1

7 5 1

Sample Output 1

YES

For example, if you select 7 and 14, the sum 21 is congruent to 1 modulo 5.

Sample Input 2

2 2 1

Sample Output 2

NO

The sum of even numbers, no matter how many, is never odd.

Sample Input 3

1 100 97

Sample Output 3

YES

You can select 97, since you may select multiples of 1, that is, all integers.

Sample Input 4

40 98 58

Sample Output 4

YES

Sample Input 5

77 42 36

Sample Output 5

NO



Sample input:
7 5 1


Sample output:
YES

Submission status: Accepted

Solution code:
A,B,C=(int(i) for i in input().split())
AA = [A*(i+1)%B for i in range(B)]
if C in AA:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
A, B, C = (int(i) for i in input().split())

AA = [A*(i+1) % B for i in range(B)]
if C in AA:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
A, B, C = (int(i) for i in input().split())

AA = [A*(i+1) for i in range(B)]

flag = 0

for i in AA:
    if i % B == C:
        flag = 1
        print("YES")
        break

if flag == 0:
    print("NO")

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())

flag=-1

for i in range(b):
    if (a*(i+1))%b==c:
        flag=1

if flag>0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
d = sorted(set([a*i%b for i in range(1,b+1)]))
print("YES" if c in d else "NO")

Submission status: Accepted

Solution code:
A,B,C=list(map(int,input().split()))
for i in range(B):
    if (A*i)%B==C:
        print("YES")
        quit()
    else:
        pass
print("NO")

Submission status: Accepted

Solution code:
a, b, c = list(map(int, input().split()))
for i in range(1, b+1):
  if (a*i)%b==c:
    print("YES")
    exit()
print("NO")

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
for i in range(1, B):
    mod = (A * i) % B
    if mod == C:
        print("YES")
        break
else:
    print("NO")

Submission status: Accepted

Solution code:
A, B, C = list(map(int, input().split()))
judge = "NO"
x = A
for i in range(B + 1):
	if x % B == C:
		judge= "YES"
		break
	x += A
print(judge)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())


for i in range(1, int(1e5)):
    if (i * a) % b == c:
        print("YES")
        break
else:
    print("NO")

Submission status: Accepted

Solution code:
a, b, c = list(map(int, input().split()))

while a % b != 0:
  a, b = b, a % b

print('YES' if c % b == 0 else 'NO')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

a, b, c = map(int, input().split())
for i in range(1, b+1):
    if a * i % b == c:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
ans = 'NO'
for i in range(A, B*A+1, A):
    if i % B == C:
        ans = 'YES'
print(ans)

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
d = A - B
if C in [d * i % B for i in range(1, B+1)]:print('YES')
else:print('NO')

Submission status: Accepted

Solution code:
import sys
A,B,C = map(int,input().split())
for i in range(1,100):
    if A * i % B == C:
        print("YES")
        sys.exit()
print("NO")

Submission status: Accepted

Solution code:
import sys
A,B,C = map(int,input().split())
for i in range(100):
    if A * i % B == C:
        print("YES")
        sys.exit()
print("NO")

Submission status: Accepted

Solution code:
a,b,c = input().split()
A = int(a)
B = int(b)
C = int(c)

i = 1
while(i<B+1):
	if((A*i)%B == C):
		print("YES")
		break
	else:
		i += 1

if(i==B+1):
	print("NO")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

A, B, C = map(int, input().split())

# 確認するのは1からBまででいい(Bの倍数分は割り切れるから余りに影響を与えない)
for i in range(1, B+1):
    if (A * i) % B == C:
        print("YES")
        exit()
print("NO")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

A, B, C = map(int, input().split())

for i in range(1, 101):
    if (A * i) % B == C:
        print("YES")
        exit()
print("NO")

Submission status: Accepted

Solution code:
# input
A, B, C = map(int, input().split())

for i in range(B + 1):
    if (A * i) % B == C:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

Solution code:
a, b, c = [int(_) for _ in input().split(' ')]
if any([(x * a) % b == c for x in range(b)]):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
a,b,c = map(int, input().split())
flag = 0
for i in range(1,b+1):
    if a*i % b == c:
        flag = 1
        break
if flag:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
sur = []
check = True
i = 1
while check:
	if (a*i)%b not in sur:
		sur.append((a*i)%b)
		i += 1
	else:
		check = False

if c in sur:
	print('YES')
else:
	print('NO')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())

for i in range(10**6):
    if A * i % B == C:
        print("YES")
        break
else:
    print("NO")

Submission status: Accepted

Solution code:
A,B,C=map(int,raw_input().split())
possible=False
for k in range(1,1001):
  if k*A % B == C:
    possible = True
if possible:
  print 'YES'
else:
  print 'NO'

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())

if C==0:
  print("YES")
elif A%B==0:
  print("NO")
else:
  ans=True
  for i in range(1,B):
    if A*i%B != 0 and C % (A*i%B)==0:
      print("YES")
      ans=False
      break
  if ans:
    print("NO")

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())

first_rest = A%B
if first_rest == C:
    print("YES")
    
else:
    i = 2
    while(1):
        if (A*i)%B == C:
            print("YES")
            break
        else:
            if (A*i)%B == first_rest:
                print("NO")
                break
            else:
                i += 1

Submission status: Accepted

Solution code:
a,b,c=map(int, input().split())
for i in range(1,b+2):
    if (a*i)%b==c:
        print('YES')
        break
else:print('NO')

Submission status: Accepted

Solution code:
from fractions import gcd
a,b,c = map(int, input().split())
r = gcd(a,b)
if c % r == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
a = A % B
for i in range(1, B + 1):
    if (a * i) % B == C:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
for n in range(a,101*a,a):
    if n%b == c:
        print('YES')
        break
else:
    print('NO')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
r = [(A * k) % B for k in range(B)]
print(["NO", "YES"][C in r])

Submission status: Accepted

Solution code:
A, B, C  = map(int, input().split())
a = A
while(a <= 10000):
    if(a%B == C):
        print("YES")
        exit()
    a += A
print("NO")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
s={(a * i) % b for i in range(1,b+1)}
print("YES" if c in s else "NO")

Submission status: Accepted

Solution code:
A,B,C = (int(i) for i in input().split())

dekiru = False
for i in range(B):
    if((A*(i+1))%B == C):
        dekiru = True

if dekiru:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())

sousu=0

for i in range(1,10000):
    sousu+=a
    if sousu%b==c:
        print("YES")
        exit()
print("NO")

Submission status: Accepted

Solution code:
A, B, C = list(map(int, input().split()))
ans = False
for i in range(B):
    if (A*i)%B == C:
        ans = True
        break
if ans:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
A,B,C = map(int, input().split())
def gcd(a,b):
    return a if b == 0 else gcd(b, a%b)
print("YES" if C % gcd(A, B) == 0 else "NO")

Submission status: Accepted

Solution code:
a, b, c = map(int,input().split())
d = 'NO'
for i in range(1,b+1):
    if(a*i%b == c):
        d = 'YES'
        break
print(d)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
i = a
rec = []
flag = False
while a < 100000:
    mod = a % b
    if mod == c:
        flag = True
        break
    else:
        a += i

if flag:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
r = []
for i in range(100):
    x = a*i%b
    if x == c:
        print("YES")
        exit()
    if x in r:
        break
    r.append(x)
print("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())

for i in range(b):
    if (a*(i+1)) % b == c:
        print("YES")
        break

else:
    print("NO")

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
Ans = "NO"
for i in range(1,101):
    if (A*i)%B==C:
        Ans="YES"
        break
print(Ans)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
n = a
while True:
	if n % b == c:
		print("YES")
		break
	n += a
	if n % b == a % b:
		print("NO")
		break

Submission status: Accepted

Solution code:
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
w = a
i = 0
while i < 100:
 if  a%b == c:
  print("YES")
  break
 else:
  a = a+w
  i = i+1
if i ==100:
 print("NO")

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())
P = A%B
for k in range(101):
    if (P*k)%B==C:
        print("YES")
        exit()
print("NO")

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split(' '))
mod = A % B
flag = 0
for x in range(1, B+1):
    if (mod * x) % B == C: flag = 1
if flag == 0: print('NO')
else: print('YES')

Submission status: Accepted

Solution code:
a,b,c = list(map(int,input().split()))
 
d = 0
ans = 'NO'
for i in range(b):
    d += a
    if d%b == c:
        ans = 'YES'
        break
print(ans)

Submission status: Accepted

Solution code:
a,b,c = list(map(int,input().split()))

d = 0
ans = 'NO'
for i in range(b):
    d += a
    if d%b == c:
        ans = 'YES'
        break
print(ans)

Submission status: Accepted

Solution code:
from math import modf


A, B, C = [int(elem) for elem in input().split(' ')]
remainder_set = set()

current_num = A
multiplier = 2
while True:
    remainder = current_num % B
    already_included = remainder in remainder_set
    if already_included:
        break
    else:
        remainder_set.add(remainder)
        current_num = A * multiplier
        multiplier += 1

if C in remainder_set:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a,b,c=map(int, input().split())
x=a
ans=0
for i in range(b):
    if x%b==c:
        ans+=1
        break
    else:
        x+=a
print('YES') if ans else print('NO')

Submission status: Accepted

Solution code:
# coding: utf-8
A, B, C = map(int, input().split())

for i in range(101):
    if (A * i) % B == C:
        print('YES')
        exit()
        
print('NO')

Submission status: Accepted

Solution code:
A, B, C = map(int, raw_input().split())
lst = [A % B]
ans = 'NO'

while True:
	tmp = (lst[-1] + A) % B
	if tmp == lst[0]:
		break
	else:
		lst.append(tmp)

if C in lst: ans = 'YES'

print ans

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())

i=1
while(True):
    if (A*i)%B == C:
        print("YES")
        break
    elif (A*i)%B == 0:
        print("NO")
        break
    i+=1

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
flag = 0
for i in range(5050):
    if A*(i+1) %B == C:
        print("YES")
        flag += 1
        break
    else:
        pass

if flag !=1:
    print('NO')

Submission status: Accepted

Solution code:
import math
import sys

def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

a = int(arr_data[0][0])
b = int(arr_data[0][1])
c = int(arr_data[0][2])

#print(a,b,c)

cnt=1

while cnt<= 100:
    
    if (c + b * cnt) % a ==0:
        
        print("YES")
        break
        
    cnt+=1
    
else:
        
    print("NO")

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
for i in range(1, B+1):
    if A*i%B==C:
        print("YES")
        break
else:
    print("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
for k in range(1, b + 1):
    if (k * a) % b == c:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

Solution code:
def exists(a, b, c):
    for i in range(b):
        if (i * (a % b)) % b == c % b:
            return True
    return False


if __name__ == '__main__':
    a, b, c = map(int, input().split())
    print('YES') if exists(a, b, c) else print('NO')

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
ok = False
k = a
for _ in range(b):
    if k % b == c:
        ok = True
        break
    k += a
if ok: print('YES')
else: print('NO')

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())

for x in range(1, b+1):
    if a * x % b == c:
        print("YES")
        break
else:
    print("NO")

Submission status: Accepted

Solution code:
def g(a,b):
    while b:a,b=b,a%b
    return a
a,b,c=map(int,input().split());print(['NO','YES'][c%g(a,b)==0])

Submission status: Accepted

Solution code:
# ABC 060 B
A, B, C = map(int, input().split())
for x in range(1, B+1):
    if A*x % B == C:
        print('YES')
        break
else:
    print('NO')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem B

if __name__ == '__main__':
    a, b, c = map(int, input().split())
    count = 1

    while count < (b + 1):
        if ((a * count) % b) == c:
            print('YES')
            exit()

        count += 1

    print('NO')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem B

if __name__ == '__main__':
    a, b, c = map(int, input().split())
    count = 1

    while count < 10001:
        if ((a * count) % b) == c:
            print('YES')
            exit()

        count += 1

    print('NO')

Submission status: Accepted

Solution code:
a, b, c = [int(i) for i in input().split()]
list = []
for i in range(1, b+1):
    list.append((a * i) % b)
if c in list:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import fractions
a,b,c = (int(i) for i in input().split())
x = fractions.gcd(a,b)
if c%x==0: print("YES")
else: print("NO")

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-

a, b, c = map(int, input().split())

result = []
i = 1
while True:
    tmp = (a * i) % b
    if tmp not in result:
        result.append(tmp)
        i += 1
    else:
        break
if c in result:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
a,b,c = map(int ,input().split())
ok = False
for i in range(1,b):
    if a*i%b == c:
        ok = True
print('YES' if ok else 'NO')

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
num = 0
while True:
    num += a
    if num % b == c:
        print('YES')
        break
    if num == a * b:
        print('NO')
        break

Submission status: Accepted

Solution code:
def gcd(x,y):
    p=max([x,y])
    q=min([x,y])
    if p%q==0:
        return q
    else:
        return gcd(q,p%q)

A, B, C = map(int, input().split())
if C%gcd(A,B)==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
for i in range(100):
  if (a*i)%b==c:
    print("YES")
    exit()
print("NO")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
d=0
for i in range(1,b+1):
    d+=1
    if a*i%b==c:
        print("YES")
        break
if d==b:
    print("NO")

Submission status: Accepted

Solution code:
import sys
A,B,C=map(int,input().split())
for i in range(100):
    if(((i+1)*A)//B*B+C==(i+1)*A):
        print("YES")
        sys.exit()
print("NO")

Submission status: Accepted

Solution code:
a,b,c=[int(i) for i in input().split()]
for i in range(1, b+1):
    if (a*i)%b == c:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
 
result = "NO"
for i in range(1, 100):
    if a * i % b == c:
        result = "YES"
print(result)

Submission status: Accepted

Solution code:
a,b,c=map(int, input().split())

flag=0
for i in range(1,b+1):
    if a*i%b==c:
        flag=1
        break

if flag==0: print("NO")
else: print("YES")

Submission status: Accepted

Solution code:
A,B,C = [int(i) for i in input().split()]
for k in range(1,B+1):
  if (k*A)%B == C:
    print('YES')
    break
else:
  print('NO')

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
https://abc060.contest.atcoder.jp/tasks/abc060_b

"""
import sys
from sys import stdin
input = stdin.readline


def solve(A, B, C):
    rem = []
    i = 1
    while True:
        t = (A*i) % B
        if not t in rem:
            rem.append(t)
        i += 1
        if i > 100000:
            break
    if C in rem:
        return 'YES'
    else:
        return 'NO'


def main(args):
    A, B, C = map(int, input().split())
    ans = solve(A, B, C)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Submission status: Accepted

Solution code:
a, b, c = list(map(int, input().split()))

def foo(a, b, c):
    seen = set()
    m = a % b
    i = m
    while i not in seen :
        if i == c:
            print("YES")
            return 
        seen.add(i)
        i = (m + i) % b
    print("NO")
foo(a, b, c)

Submission status: Accepted

Solution code:
a,b,c=map(int, input().split())
cnt = 0

for i in range(1, b+1):
   cnt += 1
   p = i*a
   if p%b==c:
      print("YES")
      break

if cnt == b:
   print("NO")

Submission status: Accepted

Solution code:
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)


a, b, c = [int(x) for x in input().split()]
re = set()
for i in range(1, int(b / gcd(a, b)) + 1):
    re.add(a * i % b)
print("YES") if c in re else print("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
for i in range(b):
    if (a * (i+1)) % b == c:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

Solution code:
k = map(int, raw_input().split())
temp = [k[0]]
for i in xrange(1000):
    if sum(temp) % k[1] == k[2]:
        print "YES"
        exit()
    temp.append(int(k[0]))

print "NO"

Submission status: Accepted

Solution code:


a,b,c=map(int, input().split())

ok = False
for p in range(1, b + 1):
    if a * p % b == c:
        ok = True
print(("NO", "YES")[ok])

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
for i in range(b):
    if (a*i)%b==c:
        print("YES")
        break

else:
    print("NO")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
for i in range(1,b+1):
    if a*i%b==c:
        print("YES")
        exit()
print("NO")

Submission status: Accepted

Solution code:
def main():
    A, B, C = map(int, input().split())

    rem = set()
    s = 0
    i = 1
    while True:
        s += A * i
        m = s % B
        if m == C:
            print("YES")
            break

        if m in rem:
            print("NO")
            break

        rem.add(m)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B,C=map(int,raw_input().split())
#print A,B,C

for i in range(1,10**5):
	if A*i%B==C:
		print "YES"
		break
else:
	print "NO"

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
for i in range(b):
    if (a*i)%b==c:
        print("YES")
        break
else:
    print("NO")

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
for k in range(1, B + 1):
    if A * k % B == C:
        print("YES")
        exit()
print("NO")

Submission status: Accepted

Solution code:
import sys
a,b,c=map(int,input().split())
for i in range(1,b):
    if(a*i%b==c):
        print('YES')
        sys.exit()
print('NO')

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())
p = 0
for i in range(B):
    if i * A % B == C:
        p = 1
        break
if p == 1:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())

def judge(a, b, c):
  for i in range(1, b * 10):
    if i * a % b == c:
      return 'YES'
  return 'NO'

print(judge(a, b, c))

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split(" "))
# print(a,b,c)
flag = 1
for i in range(101):
    temp = a * i
    if(temp % b == c):
        print("YES")
        flag = 0
        break
if(flag):
    print("NO")

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())

res = 0

sum = B + C
for i in range(100):
	sum += B
	if sum % A == 0:
		res = 1
		break

print('YES' if res == 1 else 'NO')

Submission status: Accepted

Solution code:
val = [int(x) for x in input().split()]

_sum = val[1] + val[2]
cnt = 0
res = 0

for i in range(0, 100):
    _sum += val[1]
    if _sum % val[0] == 0:
        res = 1
        break
print("YES" if res == 1 else "NO")

Submission status: Accepted

Solution code:
a, b, c = list(map(int,input().split()))
f = False
for i in range(100):
    if(a * (i + 1) % b == c):
        print("YES")
        f = True
        break
if not(f):
    print("NO")

Submission status: Accepted

Solution code:
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
w = a
i = 0
while i < 100:
 if  a%b == c:
  print("YES")
  break
 else:
  a = a+w
  i = i+1
if i ==100:
 print("NO")
else:
 a = a

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
i = 0
ans = 0
while i < B:
    if ans % B == C:
        print("YES")
        break
    ans += A
    i += 1
else:
    print("NO")

Submission status: Accepted

Solution code:
A, B, C = map(int, raw_input().split()) 
for i in xrange(1, 1000):
    if A*i%B == C:
        print "YES"
        exit()
print "NO"

Submission status: Accepted

Solution code:
a, b, c = map(int, raw_input().split())
ans = "NO"

for i in range(1, b+1):
    if (a * i) % b == c:
        ans = "YES"

print ans

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

if C % gcd(A, B) == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import fractions
A, B, C = [int(n) for n in input().split()]
if C % fractions.gcd(A, B) == 0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())

for i in range(b):
    if a * i % b == c:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
for i in range(A, A * B + 1, A):
    if i % B == C:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

Solution code:
def solve(a, b):
    c = a % b
    if c == 0:
        return b
    else:
        return solve(b, c)


A, B, C = [int(i) for i in input().split()]
z = 0
num = abs(A - B)
if num == 0:
    print('NO')
    exit()
else:
    num = solve(B, num)
if C % num == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
A, B, C = list(map(int, input().split()))
flag = False
for i in range(1, B+1):
    if (i*A)%B == C:
        flag = True
if flag:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())

for i in range(100):
    if A*i%B==C:
        print("YES")
        break
        
else:
    print("NO")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
n=[]
for x in range(1,b+1):
    n.append(a*x)

for x,y in enumerate(n):
    if y%b==c:
        print("YES")
        break
else:
        print("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
ans = "NO"
for i in range(1, int(1e6)):
  if (a * i) % b == c:
    ans = "YES"
    break
print(ans)

Submission status: Accepted

Solution code:
a,b,c=[int(x) for x in input().split()]
import sys
for i in range(1,b+1):
    if a*i%b==c:
        print("YES")
        sys.exit()
print("NO")

Submission status: Accepted

Solution code:
def main():
    a, b, c = map(int, input().split())

    flag = 1
    comp = a
    while comp <= a*b:
        if comp%b == c:
            print("YES")
            flag = 0
            break
        comp += a

    if flag: print("NO")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())

X = False

for i in range(1,B+1):
    if A*i%B == C:
        X = True

if X:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
A,B,C=[int(i) for i in input().split()]

for i in range(B):
    if A*(i+1)%B==C:
        print('YES')
        break
else:
    print('NO')

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
d=a%b
i=1
while 1:
    if d*i%b==c:
        print("YES")
        break
    elif d*(i+1)%b==d:
        print("NO")
        break
    else:
        i+=1

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
loop = int(5050 / A)
x = 0
for i in range(1, loop+1):
    if A * i % B == C:
        x += 1
    else:
        pass

if x > 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
li = []
i = 1
while i >= 0:
    ans = (a*i) % b
    if ans == c:
        print("YES")
        break
    else:
        al = ans in li
        if al == True:
            print("NO")
            break
        else:
            li.append(ans)
    i += 1

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import sys
import re
import math
import collections
import itertools
import functools

DEBUG = True
DEBUG = False

def dbg(*args):
    if DEBUG:
        print("DBG: ", file=sys.stderr, end="")
        print(*args, file=sys.stderr)



def main():
    A, B, C = map(int, input().split())

    for i in range(A, A*B+1, A):
        if i % B == C:
            print("YES")
            return

    print("NO")

if __name__ == "__main__": main()

Submission status: Accepted

Solution code:
from collections import defaultdict


def main():
    A, B, C = map(int, input().split())
    for i in range(1, 1000):
        if A * i % B == C:
            print("YES")
            return
    print("NO")



if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())

for i in range(1, a + 2):
    if (b * i + c) % a == 0:
        print('YES')
        break
else:
    print('NO')

Submission status: Accepted

Solution code:
if __name__ == "__main__":
    A,B,C = map(int, input().split())
    res = set()
    a = A % B
    while (True):
        if a in res:
            break
        res.add(a)
        a += A % B
        a %= B
    if C in res:
        print ("YES")
    else:
        print ("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split(" "))


for i in range(1, b):
    if (a * i) % b == c:
        print("YES")
        break
else:
    print("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
ans = "NO"
for i in range(100):
    if a * i % b == c:
        ans = "YES"
print(ans)

Submission status: Accepted

Solution code:
# CHoose Integers
a,b,c = list(map(int, input().split()))

f = False
for i in range(b):
    if( ((i+1)*(a%b)+c)%b==0 ):
        f = True
        break
if f:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
sum_all = 0
count = 0
for i in range(1,101):
    if (a * i) % b == c:
        print("YES")
        break
    else:
        count += 1
        if count == 100:
            print("NO")
            break

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
for i in range(b):
    if a*i%b==c:
        print("YES")
        exit(0)
else:
    print("NO")

Submission status: Accepted

Solution code:
from fractions import gcd

a,b,c = map(int, raw_input().split())

if c % gcd(a,b) == 0:
	print "YES"
else:
	print "NO"

Submission status: Accepted

Solution code:
import sys

# sys.stdin = open('b1.in')


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


a, b, c = map(int, input().split())

d = gcd(a, b)
if c % d == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys

# sys.stdin=open('b1.in')

a, b, c = map(int, input().split())

res = 'NO'
for k in range(1, b + 1):
    if k * a % b == c:
        res = 'YES'
        break
print(res)

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())
list=[]
for i in range(B):
    list.append((i*A)%B)
if C in list:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
a,b,c = map(int, input().split())
flag = 0
for i in range(1,b+1):
    if (a*i-c)%b==0:
        flag = 1
        break
print('YES' if flag == 1 else 'NO')

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
sum_all = 0
count = 0
for i in range(1,101):
    if (a * i) % b == c:
        print("YES")
        break
    else:
        count += 1
        if count == 100:
            print("NO")
            break

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
flag = 0
for i in range(100):
    if a*i%b == c :
        flag = 1
if flag == 1 :
    print("YES\n")
else :
    print("NO\n")

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())

for i in range(1000):
    if A * i % B == C:
        print("YES")
        break
    
if A * i % B != C:
    print("NO")

Submission status: Accepted

Solution code:
A,B,C=map(int,raw_input().split())

def gcd(a,b):
    while a!=0:
        c=a
        a=b%a
        b=c
    return b

g = gcd(A,B)
print "YES" if C%g == 0 else "NO"

Submission status: Accepted

Solution code:
i = input().split()
a = int(i[0])
b = int(i[1])
c = int(i[2])

answer = "NO"
count = a

for i in range(1,b+1):
    if (i*a)%b==c:
        answer = "YES"

    
print(answer)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())

result = "NO"

for i in range(a, a*b+a, a):
    if i % b is c:
        result = "YES"
        break

print(result)