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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print("YES"if a%b!=0  else"NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
(a,b,c) = ([int(i) for i in input().split()])
ans = 0
s = 0
for n in range(1,11):
    s = sum(range(1,n+1))*a - c
    if s % b == 0:
        ans = 1
        break
        
if ans:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
(a,b,c) = ([int(i) for i in input().split()])
ans = 0
for n in range(1,11):
    s = a*(2*n-1) + c
    if s % b == 0:
        ans = 1
        break
        
if ans:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
(a,b,c) = ([int(i) for i in input().split()])
ans = 0
for n in range(1,11):
    s = a*n + c
    if s % b == 0:
        ans = 1
        break
        
if ans:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
temp = input().rstrip().split(" ")
A = int(temp[0])
B = int(temp[1])
C = int(temp[2])

if A == B and C > 0:
    print("NO")
elif A == 1:
    print("YES")
elif A + C == B:
    print("YES")
else:     
    print("NO")

Submission status: Wrong Answer

Solution code:
temp = input().rstrip().split(" ")
A = int(temp[0])
B = int(temp[1])
C = int(temp[2])

if A == B and C > 0:
    print("No")
elif A == 1:
    print("Yes")
elif A + C == B:
    print("Yes")
else:     
    print("No")

Submission status: Wrong Answer

Solution code:
def func():
    pass


def main():
    a, b, c = map(int, input().split())
    l = []
    i = 1
    while True:
        x = a * i
        left = x % b
        if left == c:
            print("Yes")
            return
        if left in l:
            print("No")
            return
        l.append(left)
        i += 1


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
i = a % b
init_i = i
i_list = []
while True:
    print(i)
    if i%b ==  c:
        print('YES')
        exit()
    if i in i_list:
        print('NO')
        exit()
    i_list.append(i)
    i = (i+init_i) % b

Submission status: Wrong Answer

Solution code:
a,b,c = (int(i) for i in input().split())

flag = 0
for i in range(102):
  if(a*i)%b == c:
    flag =1
if flag == 0:
  ans ='No'
else:
  ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int,input().split())
if A%2 == 0 and B%2 == 0 and C%2 != 0 :
    print("NO")
elif A%2 != 0 and B%2 == 0 and C%2 == 0 :
    print("NO")
else :
    print("YES")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a % b == 0:
  print("YES" if c==0 else "NO")
elif a % b != 0 and b % a == 0:
  print("YES" if c%a==0 else "NO")
else:
  print("YES")

Submission status: Wrong Answer

Solution code:
a ,b ,c  = map(int, input().split())
if a%b == 0:
    print("YES")
else:print("NO")

Submission status: Wrong Answer

Solution code:
a ,b ,c  = map(int, input().split())
a = a%b
m = min(a,c)
M = max(a,c)
if m != 0:
        if (b-M)%m == 0:
            print("YES")
        else:print("NO")
else:print("NO")

Submission status: Wrong Answer

Solution code:
a ,b ,c  = map(int, input().split())
a = a%b
m = min(a,c)
M = max(a,c)
if m != 0:
        if (b-M)%m == 0:
            print("Yes")
        else:print("No")
else:print("No")

Submission status: Wrong Answer

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")
        break

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if abs(b-c)%a==0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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


def main():
    """Function."""
    a, b, c = map(int, input().split())

    check = set()
    temp = a
    flag = 0
    while temp % b not in check:
        print(check)
        print(temp)
        if c in check:
            flag = 1
            break
        else:
            check.add(temp % b)
            temp = temp + a

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


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split(" "))
l = []
for i in range(10000000):
  tmp = A*i%B
  if tmp in l:
    break
  l.append(tmp)
if C in l:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

for i in range(1, 1000):
  if A * i % B == C:
    print("Yes")
    exit(0)
print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
A_ = A
counter = 0
while True:
    if A_%B == C:
        print("Yes")
        break
    A_ += A
    counter += 1
    if counter > B:
        print("No")
        break
#なんか知らんが動いた！
#go

Submission status: Wrong Answer

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

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

    else:
        print('NO')
        exit()

Submission status: Wrong Answer

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

for i in range(1, b+1):
  if (a*i) % b == c:
    print('Yes')
    sys.exit()
print('No')

Submission status: Wrong Answer

Solution code:
# coding: utf-8
A, B, C = map(int, input().split())
print(any([(A*i)%B==C for i in range(1,B+1)]) and "Yes" or "NO")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
A, B, C = map(int, input().split())
print(any((A*i)%B==C for i in range(1,B+1)) and "Yes" or "NO")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
A, B, C = map(int, input().split())
print(any(A*i%B==C for i in range(1,B+1)) and "Yes" or "NO")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

if a == 1:
    print("YES")
    
elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    print("YES")
elif a % 2 != 0 and b % 2 != 0 and c % 2 != 0:
    print("YES")
elif a % 2 != 0 and b % 2 != 0 and c % 2 == 0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

if a == 1:
    print("YES")
    
elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    print("YES")
elif a % 2 != 0 and b % 2 != 0 and c % 2 != 0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

test = (B*C)/A
       
if test == int(test):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
def gcd(a,b):
    if b==0:return a
    else:return gcd(b, a%b)
a,b,c=map(int,input().split())
print('YNEOS'[c%gcd(a,-b)>0::2])

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split(" ")))
i = a[0]
count = 0
while i <= 1000:
    if i % a[1] == a[2]:
        count += 1
    i += a[0]
if count >= 1:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a = list(map(int,input().split(" ")))
i = a[0]
count = 0
while i <= 100:
    if i % a[1] == a[2]:
        count += 1
    i += a[0]
if count >= 1:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
ini=A%B
tmp=ini
while(1):
  if(tmp==C):
    print("Yes")
    break
  else:
    tmp+=ini
    tmp=tmp%B
    if(tmp==ini):
      print("No")
      break

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
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: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
lis = list(range(1, 100000))
AA =0
for i in lis:
    AA = A*i
    if AA%B == C:
        print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
lis = list(range(1, 1000))
AA =0
for i in lis:
    AA += A*i
    if AA%B == C:
        print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
lis = list(range(1, 1000))
for i in lis:
    if (A*i)%B == C:
        print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

while True:
    amari = (modL[len(modL)-1]+a)%b
    if amari == c:
        print("Yes")
        break
    elif amari in modL:
        print("No")
        break
    else:
        modL.append(amari)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
res = []
i = 1
while True:
    r = (a * i) % b
    if r == c:
        print("Yes")
        break
    else:
        if r in res:
            print("No")
            break
        else:
            res.append(r)
    i += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c =map(int,input().split())
if a==1:
    print('YES')
elif a%2==0 and b%2==0 and c%2==1:
    print('NO')
elif a%2==1 and b%2==0 and c%2==0:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
i = 1
while a * i <= a * b:
    if a * i % b == c:
        print('YES')
        exit()
    i += 1
print('No')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if b%2==0:
  if (a-c)%2==0:
    print('YES')
  else:
    print('NO')
else:
  print('YES')

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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 == 0:
        flag = 1
        print("YES")
        break

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

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

Solution code:
import numpy
import re
import math

def gcd(x, y):
    while y:
        x, y = y, x%y
    return x

def main():
	"""
	テストコード実行
	:return:
	"""
	"""
	「べズーの等式」を用いる
	"""
	a, b, c = map(int, input().split())
	print("Yes" if c % gcd(a, b) == 0 else "No")

if __name__ == '__main__':
	main()

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
A, B, C = map(int, input().split(' '))
mod = A % B
if mod == 0: print('NO')
else: print('YES')

Submission status: Wrong Answer

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

S = []
for i in range(1,C+1):
    if C%i==0: S.append(i)
        
#print(S)

now = A
while(True):
    #print(now)
    if now in S:
        print("YES")
        break
    elif now == 0:
        print("NO")
        break

    if now>=B:
        now = now%B
        A = now
    else:
        now += A

Submission status: Wrong Answer

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

S = []
for i in range(1,C+1):
    if C%i==0: S.append(i)
        
#print(S)

now = A
while(True):
    if now>=B:
        now = now%B
        A = now
    else:
        now += A
    #print(now)
    if A in S:
        print("YES")
        break
    elif A == 0:
        print("NO")
        break

Submission status: Wrong Answer

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

S = []
for i in range(1,C+1):
    if C%i==0: S.append(i)
        
#print(S)

now = A
while(True):
    if now>=B:
        now = now%B
        A = now
    else:
        now += A
    #print(now)
    if now in S:
        print("YES")
        break
    elif now == 0:
        print("NO")
        break

Submission status: Wrong Answer

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(cnt,"YES")
        break
        
    cnt+=1
    
else:
        
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

print "NO"

Submission status: Wrong Answer

Solution code:
k = map(int, raw_input().split())

if (k[0] % 2 == 0) and (k[1] % 2 == 0) and (k[2] % 2 != 0):
    print "NO"
    exit()
elif (k[0] == 1):
    print "YES"
    exit()
elif (k[0] > k[1]):
    print "NO"
    exit()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
import sys
A,B,C=[int(i) for i in input().split()]
Total=0

if(A==1):
    print("YES")
    sys.exit()

for i in range(1, 100000):
    if(Total%B==C):
        print("YES")
        sys.exit()
    Total+=A*i

print("NO")

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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

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

if gcd(A, B) == 1:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
import sys
a,b,c=map(int,input().split())
x=a%b
if x>=c:
    t=[c]+[x]
else:
    t=[x]+[c]
if t[0]==0 and t[1]==0:
    print("YES")
    sys.exit()
elif t[0]==0 or t[1]==0:
    print("NO")
    sys.exit()

if t[1]%t[0]==0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
i = 1
ans = 0
num = 0

while num < 100:
    num = a
    num = a * i
    if num % b == c:
        ans += 1
        break
    i += 1


if ans == 1:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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


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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
ans='no'
for i in range(1,100):
 if i*a%b==c:
  ans='yes'
print (ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
ans=('no')
for i in range(1,100):
 if i*a%b==c:
  ans=('yes')
print (ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
ans=('no')
for i in range(1,100):
 if (i*a)%b==c:
  ans=('yes')
print (ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
for i in range(b):
 if i*b%a==c:
  print ('yes')
else:
 print ('no')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

answer = "NO"

while a <= d:
    if a%b==c:
        answer = "YES"
        break
    a += a 
    
print(answer)

Submission status: Wrong Answer

Solution code:
# 最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# 最小公倍数
def lcm(a, b):
    return a * b // gcd(a, b)

if __name__ == "__main__":
    input_list = list(map(int, input().split()))
    print(input_list)
    a, b, c = input_list

    result = False
    lcm_of_ab = lcm(a, b)
    for i in range(lcm_of_ab // a + 1):
        if (not i):
            continue

        if (a * i) % b == c:
            result = True
            break

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

Submission status: Wrong Answer

Solution code:
def solve():
  ar = raw_input().split(' ')
  A = int(ar[0])
  B = int(ar[1])
  C = int(ar[2])

  s = set([])
  sum = 0
  while True:
    sum = sum + A
    m = sum % B
    #print 'sum=',sum,'m=',m
    if (m == C): return 'Yes'
    if (m in s): return 'No'
    s.add(m)

if __name__ == '__main__' :
  print solve()

Submission status: Wrong Answer

Solution code:
def solve():
  ar = raw_input().split(' ')
  A = int(ar[0])
  B = int(ar[1])
  C = int(ar[2])

  s = set([])
  sum = 0
  while True:
    sum = sum + A
    m = sum % B
    print 'sum=',sum,'m=',m
    if (m == C): return 'Yes'
    if (m in s): return 'No'
    s.add(m)

if __name__ == '__main__' :
  print solve()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = [int(x) for x in input().split()]

def foo(a, b, c):
    for i in range(1, b+1):
        if (a*i)%b == c:
            return True
    return False
    
print(foo(a, b, c))

Submission status: Wrong Answer

Solution code:
abc = list(map(int, input().split()))
a = abc[0]
b = abc[1]
c = abc[2]

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
z = float('inf')
n = int(a / b) + 1
flag = False

while True:
    x, y = divmod(n * b + c, a)
    if not x:
        flag = True
        break
    elif y >= z:
        break
    else:
        n += 1
        z = min(z, y)

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

Submission status: Wrong Answer

Solution code:
a,b,c = [int(i) for i in input().split()]
arr = set()
ret = "NO"
r = a%b
if r==0:
    if c==0:
        ret="YES"
    else:
        pass
elif r==1:
    ret = "YES"
else:
    rr = r
    while not(rr in arr):
#        print(arr,rr)
        if rr <= c and (c-rr)%r == 0:
            ret = "YES"
            break
        else:
            arr.add(rr)
            n = int(b-rr)/r
            n += 1 if (b-rr)%r != 0 else 0
            rr = (n*r + rr)%b
print(ret)

Submission status: Wrong Answer

Solution code:
a,b,c = [int(i) for i in input().split()]
arr = set()
ret = "NO"
r = a%b
if r==0:
    if c==0:
        ret="YES"
    else:
        pass
elif r==1:
    ret = "YES"
else:
    n = int(b/r)
    rr = r
    while not(rr in arr):
        #print(arr,rr)
        if rr <= c and (c-rr)%r == 0:
            ret = "YES"
            break
        else:
            arr.add(rr)
            rr = (n*r+rr)%b
print(ret)

Submission status: Wrong Answer

Solution code:
a,b,c = [int(i) for i in input().split()]
arr = set()
ret = "NO"
r = a%b
if r==0:
    if c==0:
        ret="YES"
    else:
        pass
elif r==1:
    ret = "YES"
else:
    n = int(b/r)
    rr = r
    while not(rr in arr):
        print(arr,rr)
        if rr <= c and (c-rr)%r == 0:
            ret = "YES"
            break
        else:
            arr.add(rr)
            rr = (n*r+rr)%b
print(ret)

Submission status: Wrong Answer

Solution code:
a,b,c = [int(i) for i in input().split()]
arr = set()
ret = "NO"
r = a%b
while True:
    if r == 0:
        ret = "YES" if c == 0  else "NO"
        break
    if c%r == 0 or c == 0:
        ret = "YES"
        break
    arr.add(r)
    rr = int(b/r)
    r = ((rr+1)*r)%b
    if r in arr:
        break
print(ret)

Submission status: Wrong Answer

Solution code:
import sys

a,b,c = [int(i) for i in input().split()]
arr = set()
ret = "NO"
r = a%b
while True:
    if r == 0:
        ret = "YES" if c == 0  else "NO"
        break
    if c%r == 0:
        ret = "YES"
        break
    arr.add(r)
    rr = int(b/r)
    r = ((rr+1)*r)%b
    sys.stderr.write(str(r)+"\n")
    if r in arr:
        break
print(ret)

Submission status: Wrong Answer

Solution code:
a,b,c = [int(i) for i in input().split()]
arr = set()
ret = "NO"
r = a%b
while True:
    if r == 0:
        ret = "YES" if c == 0  else "NO"
        break
    if c%r == 0:
        ret = "YES"
        break
    arr.add(r)
    rr = int(b/r)
    r = ((rr+1)*r)%b
    if r in arr:
        break
print(ret)

Submission status: Wrong Answer

Solution code:
a,b,c = [int(i) for i in input().split()]
r = a%b
if r == 0:
    print("YES" if c == 0  else "NO")
    exit()
arr = set()
no = True
while no:
    if c%r == 0:
        no = False
        break
    arr.add(r)
    rr = int(b/r)
    r = ((rr+1)*r)%b
    if r in arr:
        break
print("NO" if no else "YES")

Submission status: Wrong Answer

Solution code:
a,b,c = [int(i) for i in input().split()]
r = a%b
if r == 0 and c != 0:
    print("NO")
    exit()
arr = set()
no = True
while no:
    if c%r == 0:
        no = False
        break
    arr.add(r)
    rr = int(b/r)
    r = ((rr+1)*r)%b
    if r in arr:
        break
print("NO" if no else "YES")

Submission status: Wrong Answer

Solution code:
a,b,c = [int(i) for i in input().split()]
r = a%b
if r == 0 and c != 0:
    print("NO")
    exit()
arr = set()
no = True
while no:
    if c%r == 0:
        no = False
        break
    arr.add(r)
    rr = int(b/r)
    r = ((rr+1)*r)%b
    print(r,rr,arr)
    if r in arr:
        break
print("NO" if no else "YES")

Submission status: Wrong Answer

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

ans = 'NO'
if a[len(a)-1] == b[0]:
    if b[len(b)-1 == c[0]]:
        ans = 'YES'

print(ans)

Submission status: Wrong Answer

Solution code:
a,_,c=map(int,input().split());print(['YES','NO'][a&1==0and c&1])

Submission status: Wrong Answer

Solution code:
def main():
    n = list(map(int, input().split()))
    l = [n[0]*i for i in range(1,n[0]+1) if (n[0]*i)%n[1] == n[2] ]
    if 0 < len(l):
        print("YES")
    else:
        print("NO")

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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")
        break
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
ABC = input().split()
A=int(ABC[0])
B=int(ABC[1])
C=int(ABC[2])


count = A*B


for index in range(count+1):
    if (A*index)%B ==C:
        print("Yes")
        break
    elif index ==count:
        print("NO")

Submission status: Wrong Answer

Solution code:
ABC = input().split()
A=int(ABC[0])
B=int(ABC[1])
C=int(ABC[2])


count = 1000


for index in range(count+1):
    if (A*index)%B ==C:
        print("Yes")
        break
    elif index ==800:
        print("NO")

Submission status: Wrong Answer

Solution code:

ABC = input().split()
A=int(ABC[0])
B=int(ABC[1])
C=int(ABC[2])


count = 1000


for index in range(count+1):
    if (A*index)%B ==C:
        print("Yes")
        break
    elif index ==count:
        print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
n=2
tmpl=[]
while n < 100:
    n=n+1
    tmp=(n*A)%B
    tmpl.append(tmp)
    if tmp==C:
        print('YES')
        break
    elif (tmpl[0]==tmp):
        print('NO')
        break
    else:
        pass

Submission status: Wrong Answer

Solution code:
ABC = input().split()
A=int(ABC[0])
B=int(ABC[1])
C=int(ABC[2])


count = 10000


for index in range(count+1):
    if (A*index)%B ==C:
        print("Yes")
        break
    elif index ==count:
        print("NO")

Submission status: Wrong Answer

Solution code:

ABC = input().split()
A=int(ABC[0])
B=int(ABC[1])
C=int(ABC[2])


count = 1000


for index in range(count+1):
    if (A*index)%B ==C:
        print("Yes")
        break
    elif index ==count:
        print("NO")

Submission status: Wrong Answer

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

k = A % B

if k == 0:
	if C == 0:
		print('YES')
	else:
		print('NO')
else:
	if k % 2 == 0:
		if C % 2 == 0:
			print('YES')
		else:
			if B % 2 == 0:
				print('NO')
			else:
				print('YES')
	else:
		print('YES')

Submission status: Wrong Answer

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