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:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if c == 0:
    print('YES')
elif a == 1:
    print('YES')
elif b == 1:
    if c == 0:
        print('YES')
    else:
        print('NO')
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')
#elif a % 2 == 0 and b % 2 == 1 and c % 2 == 1:
#    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if c == 0:
    print('YES')
elif a == 1:
    print('YES')
elif b == 1:
    if c == 0:
        print('YES')
    else:
        print('NO')
elif a % b == 0:
    if c % (a/b) == 0:
        print('YES')
    else:
        print('NO')
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')
elif a % 2 == 0 and b % 2 == 1 and c % 2 == 1:
    print('NO')
#elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
#    if a % b == 0:
#        if (c/2) % (a/b) == 0:
#            print('YES')
#        else:
#            print('NO')
#    else:
#        print('YES')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if c == 0:
    print('YES')
elif a == 1:
    print('YES')
elif b == 1:
    if c == 0:
        print('YES')
    else:
        print('NO')
elif a % b == 0:
    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')
elif a % 2 == 0 and b % 2 == 1 and c % 2 == 1:
    print('NO')
#elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
#    if a % b == 0:
#        if (c/2) % (a/b) == 0:
#            print('YES')
#        else:
#            print('NO')
#    else:
#        print('YES')
else:
    print('YES')

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 B % 2 == 0:
		if k % 2 == 0:
			if C % 2 == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	else:
		if B % 5 == 0:
			if k % 2 ==0:
				if C % 2 == 0:
					print('YES')
				else:
					print('NO')
			else:
				print('YES')
		else:
			print('YES')

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 B % 2 == 0:
		if k % 2 == 0:
			if C % 2 == 0:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
	else:
		if B % 5 == 0:
			if k % 2 ==0:
				print('NO')
			else:
				print('YES')
		else:
			print('YES')

Submission status: Wrong Answer

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

b()

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if c == 0:
    print('YES')
elif a == 1:
    print('YES')
elif b == 1:
    if c == 0:
        print('YES')
    else:
        print('NO')
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')
elif a % 2 == 0 and b % 2 == 1 and c % 2 == 1:
    print('NO')
#elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
#    if a % b == 0:
#        if (c/2) % (a/b) == 0:
#            print('YES')
#        else:
#            print('NO')
#    else:
#        print('YES')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if 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')
elif c == 0:
    print('YES')
elif a == 1:
    print('YES')
elif b == 1:
    if c == 0:
        print('YES')
    else:
        print('NO')
elif a % 2 == 0 and b % 2 == 1 and c % 2 == 1:
    print('NO')
#elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
#    if a % b == 0:
#        if (c/2) % (a/b) == 0:
#            print('YES')
#        else:
#            print('NO')
#    else:
#        print('YES')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if 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')
elif c == 0:
    print('YES')
elif a == 1:
    print('YES')
elif a % 2 == 0 and b % 2 == 1 and c % 2 == 1:
    print('NO')
#elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
#    if a % b == 0:
#        if (c/2) % (a/b) == 0:
#            print('YES')
#        else:
#            print('NO')
#    else:
#        print('YES')
else:
    print('YES')

Submission status: Wrong Answer

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

b()

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if 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')
elif c == 0:
    print('YES')
elif a == 1:
    print('YES')
#elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
#    if a % b == 0:
#        if (c/2) % (a/b) == 0:
#            print('YES')
#        else:
#            print('NO')
#    else:
#        print('YES')
else:
    print('YES')

Submission status: Wrong Answer

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

amari = []

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

    else:
        if a % b not in amari:
            amari.append(a % b)
        else:
            print("NO")
            break

Submission status: Wrong Answer

Solution code:
abc=  input()
#abc = '1 10 97'
a, b, c = abc.split(' ')
if abs(int(a)-int(b)) >= int(c) and int(a) != 0: #and int(c)%2 == 0:
    print('YES')
elif abs(int(a)-int(b)) >= int(c) and int(a) == 0 and int(c) != 0:
    print('NO')
elif int(a)== 0 and int(c) == 0:
    print('YES')
#elif int(a)%2 != 0 and int(c)%2 != 0:
#    print('YES') 
else:
    if int(a) == 1:
        print('YES')
#    elif int(a)== 0:
#        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if 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')
elif c == 0:
    print('YES')
elif a == 1:
    print('YES')
elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a % b == 0:
        if (c/2) % (a/b) == 0:
            print('YES')
        else:
            print('NO')
    else:
        print('YES')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if 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')
elif a == 1:
    print('YES')
elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a % b == 0:
        if (c/2) % (a/b) == 0:
            print('YES')
        else:
            print('NO')
    else:
        print('YES')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if 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')
elif a == 1:
    print('YES')
elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if (c/2) % (a/b) == 0:
        print('YES')
    else:
        print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
lisA = range(a, 100, a)
lisB = range(b+c, 100, b)
setA = set(lisA)
setB = set(lisB)
lisC = list(setA & setB)

if len(lisC) == 0:
    print("NO")
else: 
    print("YES")

Submission status: Wrong Answer

Solution code:
abc=  input()
#abc = '1 10 97'
a, b, c = abc.split(' ')
if abs(int(a)-int(b)) >= int(c): #and int(c)%2 == 0:
    print('YES')
#elif int(a)%2 != 0 and int(c)%2 != 0:
#    print('YES') 
else:
    if int(a) == 1:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if 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')
elif a == 1:
    print('YES')
elif a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
    if a % b != 0:
        print('NO')
    elif (c/2) % (a/b) == 0:
        print('YES')
    else:
        print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
l=[A]
n=2
while l[-1]<10000:
    l.append(n*A)
    n=n+1
print(l)
for i in range(len(l)):
    if l[i]%B==C:
        print('YES')
        break
else:
    print('NO')

Submission status: Wrong Answer

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

s = 1
if A < B:
    s = B//A + 1
syo = A*s % B   # 2とか
if syo == 0 and C == 0:
    print("YES")
elif syo == 0:
    print("NO")
else:
    flag = 0
    for i in range(1,97*93):
        if syo*i % B == C:
            print("YES")
            flag = 1
            break
    if flag == 0:
        print("NO")

Submission status: Wrong Answer

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

s = 1
if A < B:
    s = B//A + 1
syo = A*s % B   # 2とか
if syo == 0 and C == 0:
    print("YES")
elif syo == 0:
    print("NO")
else:
    flag = 0
    for i in range(1,100):
        if syo*i % B == C:
            print("YES")
            flag = 1
            break
    if flag == 0:
        print("NO")

Submission status: Wrong Answer

Solution code:
abc=  input()
#abc = '40 98 58'
a, b, c = abc.split(' ')
if abs(int(a)-int(b)) >= int(c): #and int(c)%2 == 0:
    print('YES')
#elif int(a)%2 != 0 and int(c)%2 != 0:
#    print('YES') 
else:
    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 B % 2 == 0:
		if k % 2 == 0:
			print('YES')
		else:
			print('NO')
	else:
		if B % 5 == 0:
			if k % 2 ==0:
				print('NO')
			else:
				print('YES')
		else:
			print('YES')

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if (B - C)%A == 0:
    print("YES")
else:
    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 B % 2 == 0:
		if k % 2 == 0:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if 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')
elif a == 1:
    print('YES')
elif a % 2 ==0 and b % 2 == 0 and a >= c:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
abc=  input()

a, b, c = abc.split(' ')
if int(a)%int(b) == 0 and int(c)%int(b) == 0:
    print('YES')
elif int(a)%int(b) != 0 and int(c)%int(b) != 0:
    print('YES') 
else:
    if int(a) == 1:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
# coding: utf-8

a, b, c = map(int, raw_input().split())
s = 0
n = ""
l = 0
while True:
    s += a
    if s % b == c:
        print "YES"
        break

    n = n + str(s % b)
    l = len(n)

    if l % 2 == 0:
        l = l / 2
        if n[:l] == n[l:]:
            print "NO"
            break

Submission status: Wrong Answer

Solution code:
#! -*- coding:utf-8 -*-
a,b,c = map(int,input().split())

if 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:
abc=  input()
 
a, b, c = abc.split(' ')
if int(a)%2 == 0 and int(c)%2 == 0:
    print('YES')
elif int(a)%2 != 0 and int(c)%2 != 0:
    print('YES') 
else:
    if int(a) == 1:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
def choose_intenger(s):
    a, b, c = map(int, s.split())
    for i in range(c):
        if ( a + a*i ) % b == c:
            print("YES")
            return 

    print("NO")

# choose_intenger("77 42 36")
choose_intenger(input())

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math

a,b,c=[int(i) for i in input().split()]
ct=0
for i in range(b+1):
    if i==0: continue
    if (a*i)%b==c:
        ct+=1
        break

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

a, b, c = map(int, raw_input().split())
s = 0
n = ""
l = 0
while True:
    s += a
    if s % b == c:
        print "YES"
        break

    n = n + str(s % b)
    l = len(n) / 2
    if n[:l] == n[l:]:
        print "NO"
        break

Submission status: Wrong Answer

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

s = 1
if A < B:
    s = B//A + 1
syo = A*s % B   # 2とか
def ans(syo, B, C):
    for i in range(1,101):
        if syo * i % B == C:
            return "YES"
    return "NO"
print(ans(syo, B, C))

Submission status: Wrong Answer

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

s = 1
if A < B:
    s = B//A + 1
syo = A*s % B   # 2とか
def ans(syo, B, C):
    for i in range(100):
        if syo * i % B == C:
            return "YES"
    return "NO"
print(ans(syo, B, C))

Submission status: Wrong Answer

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

x = A % B

print(C,x)

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

Submission status: Wrong Answer

Solution code:
import sys

def main():
    line = sys.stdin.readline()
    lst = line.split()
    a = int(lst[0])
    b = int(lst[1])
    c = int(lst[2])

    if a == 1:
        print("YES")
        return 0

    mod = a % b
    # sys.stderr.write(str(mod) + "\n")
    mod_lst = [mod]
    tmp_num = mod * a

    while True:
        mod = tmp_num % b
        if mod in mod_lst:
            # sys.stderr.write("--")
            # sys.stderr.write(str(mod) + "\n")
            # sys.stderr.write(str(mod_lst) + "\n")
            break
        else:
            # sys.stderr.write(str(mod) + "\n")
            mod_lst.append(mod)
            tmp_num = mod * a

    if c in mod_lst:
        print("YES")
    else:
        print("NO")

    return 0

if __name__ == '__main__':
    sys.exit(main())

Submission status: Wrong Answer

Solution code:


a,b,c = map(int, input().split())
rem = -1
flag = False
for i in range(10):
    rem = (a * i) % b
    if rem == c:
        flag = True
if flag:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:

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

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


print('NO')

Submission status: Wrong Answer

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

if B + C <= 100:
    print('YES')
else:
    print('NO')

Submission status: Time Limit Exceeded

Solution code:
# ABC060 B - Choose Integers
A,B,C = map(int,input().split())
for i in range(2,100001):
    A +=A*i
    if A%B==C:
        print('YES')
        exit()
print('NO')

Submission status: Time Limit Exceeded

Solution code:
a,b,c=map(int,input().split())
moda=a%b
keep=0
for i in range(0,10**8):
  if (moda*i)%b==c:
    keep=1
    print("YES")
    break
if keep==0:
  print("No")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

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

count = 1
while B > count:
  if A * count % B == C:
    print("YES")
    exit(0)
print("NO")

Submission status: Time Limit Exceeded

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

for i in range(10**7):
    n = a * i
    if n % b == c:
        print('YES')
        quit()
print('NO')

Submission status: Time Limit Exceeded

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

i = 1
while a * i <= 10 ** 10:
    if (a * i) % b == c:
        print("YES")
        exit()
    i += 1

print("NO")

Submission status: Time Limit Exceeded

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

print('NO')

Submission status: Time Limit Exceeded

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

for i in range(10**9):
  if (a*i)%b==c:
    print("YES")
    sys.exit()
print("NO")

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
A,B,C = map(int, input().split())
n = A
while n < 100000000:
  if n % B == C:
    print("YES")
    break;
  n += A
if n > 100000000:
  print("NO")

Submission status: Time Limit Exceeded

Solution code:
row = list(map(int, input().split()))
Flag = False
for i in range(10000000):
    if row[0]*i % row[1] == row[2]:
        Flag = True
        break
if Flag:
    print("YES")
else:
    print("NO")

Submission status: Time Limit Exceeded

Solution code:
def main():
    input = sys.stdin.readline
    try:
        a, b, c = map(int, input().split())
        for i in range(a, 100000000, a):
            if i % b == c:
                print("YES")
                break
        else:
            print("NO")

    finally:
        input = None

import sys; sys.setrecursionlimit(50000)
if __name__ == "__main__":
    main()

Submission status: Time Limit Exceeded

Solution code:
def hantei():
  a,b,c = map(int, input().split())
  r = a % b
  x = r

  while x != b:
    
    if x == c:
      return("YES")
    x += r
    if x > b:
      x = x % b
      
  return("NO")

print(hantei())

Submission status: Time Limit Exceeded

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

Submission status: Time Limit Exceeded

Solution code:
#60b
a,b,c =map(int,input().split())
i=0
aa=a
while i<b:
    if aa%b == c:
        print('YES')
        exit()
    aa+=a
print('NO')

Submission status: Time Limit Exceeded

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

amari = []

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

    else:
        if a % b not in amari:
            amari.append(a % b)
        else:
            print("NO")

Submission status: Accepted

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

ans = 'NO'
for i in range(1, b+1):
  mod = (a*i) % b
  if mod == c:
    ans = 'YES'
    break
  elif mod in hist:
    break
  hist.append(mod)
    
print(ans)

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:
from math import gcd
numbers = list(map(lambda x: int(x), input().split()))
a, b, c = numbers[0], numbers[1], numbers[2]
print('YES') if not c % gcd(a, b) else print('NO')

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C=map(int, input().split(" "))
candidate=[(A*i)%B for i in range(1, B-1)]

if C in candidate:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
def answer(a: int, b: int, c: int) -> str:
    for i in range(1, b + 1):
        if a * i % b == c:
            return 'YES'
    return 'NO'


def main():
    a, b, c = map(int, input().split())
    print(answer(a, b, c))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A, B, C=map(int, input().split(" "))
mod=[]
pivot=1
step=1

while True:
  pivot = (step*A)%B
  if (step*A)%B==C:
    print('YES')
    #print('debug', step)
    break
  elif pivot in mod:
    print('NO')
    break
  else:
    mod.append(pivot)
    step=step+1

Submission status: Accepted

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

aa = a
s = a % b
data = []

while True:
  aa += a
  data.append(aa % b)
  if aa % b == s:
    break
    
data.sort()

if a % b == 0:
  print("NO")
elif c % data[1] != 0:
  print("NO")
else:
  print("YES")

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:
A, B, C = map(int, input().split())
while B != 0:
  A, B = B, A % B
print('YES' if C % A == 0 else 'NO')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
for i in range(1,b+1):
    k = (a*i)%b
    if k == c:
        print("YES")
        exit()
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()
  elif i == b:
    print("NO")

Submission status: Accepted

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

for i in range(1000):
    calc += A
    rem = calc % B
    if rem == C:
        print('YES')
        exit()

print('NO')

Submission status: Accepted

Solution code:
lst = input().split()

A = int(lst[0])
B = int(lst[1])
C = int(lst[2])

L = []

for i in range(1, B+1):
   L.append((A * i) % B)

if C in L:
   print('YES')
else:
   print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

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

ans = "NO"
for i in range(B+1):
    res = A * i % B
    if res == C:
        ans = "YES"
        break

print(ans)

Submission status: Accepted

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

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

mod = []
for i in range(max(B,C)):
    res = A * i % B
    if res == C:
        ans = "YES"
        break
    if res in mod:
        ans = "NO"
        break
    mod.append(res)

print(ans)

Submission status: Accepted

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

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

else:
  mod_list = []
  for i in range(b):
    mod = (i*ganma)%b
    mod_list.append(mod)

  zero_one_list = []
  for i in range(b):
    if mod_list[i] == c:
      zero_one_list.append(1)
    else:
      zero_one_list.append(0)
    
  sum_list = sum(zero_one_list)

  if sum_list >= 1:
    print("YES")
  else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1, B):
    if (A * i) % B == C:
        clear = 1
        break

if clear == 0:
    print('NO')
else:
    print('YES')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, 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())
cnt = 0
for i in range(1, 10**5):
    if (a*i)%b == c:
        print("YES")
        break
    else:
        cnt += 1
        if cnt == 10**5 - 1:
            print("NO")
            break

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
count = 0
#aに１～bの数をかけたリスト
for i in range(b + 1):
    if ((i * a) % b) == c:
      print("YES")
      count += 1
      break
    else:
      pass

if count == 0:
  print("NO")
else:
  pass

Submission status: Accepted

Solution code:
a,b,c = map(int,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())

check = False
for i in range(1, B+1):
  if (A * i) % B == C:
    check = True
    
print("YES" if check else "NO")

Submission status: Accepted

Solution code:
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext
# input = sys.stdin.readline 
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    a, b, c = i_map()

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

    print('NO')

if __name__ == '__main__':
    main()

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())
ans = 'NO'

for i in range(1,b+1):
    mod = a*i % b
    if mod == 0:continue
    elif c % mod == 0:
        ans = 'YES'
        break

print(ans)

Submission status: Accepted

Solution code:
a, b, c = map(int,input().split())
A = []
for i in range(1,b+1):
    mod = a*i % b
    if mod in A:break
    A.append(mod)

A.sort()
if len(A) >= 2:
    i = A[1]
else:
    i = 0

if i == 0 and c == 0:
    print('YES')
    exit()
elif i == 0 and c != 0:
    print('NO')
    exit()

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

Submission status: Accepted

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

if len([A for A in range(A,10000,A) if A%B==C]):
  print('YES')
else:
  print('NO')

Submission status: Accepted

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: Accepted

Solution code:
import re
import copy

def accept_input():
    a,b,c = map(int,input().split())
    return a,b,c

a,b,c = accept_input()
aamari = a%b
amaridict = {}
curamari = a%b
for i in range(b):
    curamari = (curamari+aamari)%b
    amaridict[curamari] = 1
if c in amaridict:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

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:
A, B, C = map(int,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:
#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str


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


    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    solve(A, B, C)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

for i in range(100):
  if C == (A*i%B):
    print("YES")
    sys.exit()
print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

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