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 = map(int, input().split())
exists = False
for i in range(1, b + 1, 1):
    sum = a * i
    if (sum % b) == c:
        exists = True
        break

print('YES' if exists else '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())
x = any((a*i)%b==c for i in range(1,b+1))
print("YES" if x else "NO")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
a_=a
s=set()
while True:
  x=a_%b
  if x==c:
    print("YES")
    break
  elif x in s:
    print("NO")
    break
  else:
    s.add(x)
  a_+=a

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:
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b,c=INTM()
    a=a%b
    flg=0
    for i in range(1,b+1):
        if (a*i)%b==c:
            flg=1
    if flg==0:
        print('NO')
    else:
        print('YES')
if __name__ == '__main__':
    do()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int, input().split())
#ax%b=cになるかどうか
buf=0
for i in range(b):
    if a*i%b==c:
        buf+=1
        break
    else:
        continue
if buf==1:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
from __future__ import print_function

import sys
input = sys.stdin.readline


def main():
    a, b, c = map(int, input().strip().split())
    for k in range(1, b + 1):
        if (k * a) % b == c:
            print("YES")
            return
    print("NO")
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#python3
def main():
    a, b, c = map(int, input().split())
    f = False
    for k in range(b):
        q = a*(b+k)%b
        if q == c:
            f = True
     
    if f:
        print('YES')
    else:
        print('NO')

main()

Submission status: Accepted

Solution code:
from numpy import*;a,b,c=int_(input().split());print('YNEOS'[all(a*range(b)%b-c)::2])

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split());print('YNEOS'[all(a*i%b-c for i in range(b))::2])

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split());print('YNEOS'[all(a*i%b-c for i in range(99))::2])

Submission status: Accepted

Solution code:
#from fractions import gcd
#mod = 10 ** 9 + 7
#N = int(input())
#a = list(map(int,input().split()))
a,b,c = map(int,input().split())
tmp = 0
flag = 0
for i in range(100):
    tmp += a
    if tmp % b == c:
        flag = 1
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

flag = False
for k in range(a,b*a+1):
    if (k*a) % b == c:
        flag = True

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

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

def main():
    a,b,c=MI()
    g=gcd(a,b)
    if c%g:print("NO")
    else:print("YES")

main()

Submission status: Accepted

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

Submission status: Accepted

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



F=0
kekka=0
i=0
l=[]

while F==0:
    A=(a*i)%b
    if A==c:
        kekka="YES"
        F=1
    else:
        if l.count(A)==0:
            l.append(A)
            i+=1
        else:
            kekka="NO"
            F=1
            
print(kekka)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
sum = 0
# for i in range(1, 100):
#     sum += 3*i
#     print(sum % 7)
for n in range(1, b+1):
    sum += a
    if sum % 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"
        break

print(ans)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
x = 1
lst = []
while True:
    r = (a*x-c)%b
    if  r == 0:
        ans = "YES"
        break
    if r in lst:
        ans = "NO"
        break
    lst.append(r)
    x += 1
    
print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

tmp = []
next_num = A
while True:
    tmp.append(next_num % B)
    next_num += A
    if next_num % B in tmp:
        break

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

Submission status: Accepted

Solution code:

def ChooseIntegers():
    A, B, C = map(int, input().split())
    for i in range(1, B + 1):
        if (A * i - C) % B == 0:
            print('YES')
            return()
    print('NO')
    return()
ChooseIntegers()

Submission status: Accepted

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

ans = 'NO'

for b in range(1, B + 1):
  if A * b % B == C:
    ans = 'YES'

print(ans)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
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 = map(int,input().split())

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

Submission status: Accepted

Solution code:
abc=list(map(int,input().split()))
from fractions import gcd
ab=gcd(abc[0],abc[1])
if abc[2]%ab==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:


import numpy as np
import fractions as fra

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

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

Submission status: Accepted

Solution code:
ABC = input().split()
A, B, C = int(ABC[0]), int(ABC[1]), int(ABC[2])
memo = set()
i = 1
ans = 'NO'

while True:
  cur = (A * i) % B
  if cur == C:
    ans = 'YES'
    break
  if cur not in memo:
    memo.add(cur)
  else:
    break
  i += 1
print(ans)

Submission status: Accepted

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

x = a % b

result = 'NO'

if x == 0 and c != 0:
  print(result)
  sys.exit()

past = []
for i in range(1, 100):
  s = (x * i) % b
  if s == c:
    result = 'YES'
    break
  try:
    past.index(s)
    break
  except:
    pass
  past.append(s)

print(result)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
A, B, C = [int(x) for x in input().split()]
AmodB = A % B
if AmodB == 0:
    if C == 0:
        print("YES")
        sys.exit()
    else:
        print("NO")
        sys.exit()

mod = [AmodB]
i = AmodB
while True:
    if C in mod:
        print("YES")
        sys.exit()
    i += AmodB
    i %= B
    if i in mod:
        print("NO")
        sys.exit()
    else:
        mod.append(i)

Submission status: Accepted

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

array = []

for i in range(b):
    array.append(a*i % b)
    
ans_list = list(set(array))
    
if c in ans_list:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

print('NO')

Submission status: Accepted

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

if c%d==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

flag = False

for i in range(1, b+1):
    if a*i % b == c:
        flag = True
        break
if flag:
    print("YES")
else:
    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())
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())

tmp_A = A
for i in range(1000):
    if A % B == C:
        print("YES")
        exit()
    else:
        A += tmp_A 

print("NO")

Submission status: Accepted

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

i = 1
s = set()
while True:
    x = (A * i) % B
    if x in s:
        print("NO")
        break
    if x == C:
        print("YES")
        break
    s.add(x)
    i += 1

Submission status: Accepted

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

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

c_lis = []
for i in range(1,b+1):
    c_lis.append(a*i%b)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print('YES' if cnt==1 else '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:
a, b, c = map(int, input().split())

ans = "NO"
for i in range(10000):
    if a * i % b == c:
        ans = "YES"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions
a,b,c=map(int,input().split())
print("YES" if c%fractions.gcd(a,b)==0 else "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')
        exit(0)
print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
l=[]
for i in range(b):
    l.append((a*i)%b)
if l.count(c)>0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

li=[(i*a)%b for i in range(1,1001)]

if c in li:
  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*a):
  mul = i*a
  if mul%b==c:
    ans = "YES"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
lst = [(a*i)%b == c for i in range(1, b+1)]
print('YES' if any(lst) else '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:
a,b,c=map(int,input().split())
flag="NO"
for i in range(1,100):
  if a*i%b==c:
    flag="YES"
    break
print(flag)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import time
bbn=1000000007
	
#+++++

def gcb(a,b):
	if b == 0:
		return a
	else:
		gcb(b, b%a)
	
def main():
	#st=time.time()
	a, b , c = map(int, input().split())
	for i in range(100000):
		if a * i % b == c:
			return 'YES'
	return 'NO'

	#print(gcb(b,))
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

Submission status: Accepted

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

mod_list = []
tot = 0

for i in range(1,101):
    tot += a
    mod_list.append(tot%b)

if mod_list.count(c) >= 1:
    ans = 'YES'
else:
    ans = 'NO'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = input().split()
j = 0
d = 0
for i in range(int(a[1])):
    j += 1
    s = int(a[0]) * j
    if s % int(a[1]) == int(a[2]):
        print('YES')
        d = 1
        break
if d == 0:
    print('NO')

Submission status: Accepted

Solution code:
# 少ないので実際にやる
# あまりはループするので、0かループした時点で終了
a, b, c = map(int, input().split())
aa = a
lis = []
while True:
    aa = aa + a
    d = aa % b
    if b == 0 or d in lis:
        print("NO")
        exit()
    lis.append(d)
    if d == c:
        print("YES")
        exit()

Submission status: Accepted

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

s = set()
tmp = a
while True:
    if (tmp % b) in s:
        print("NO")
        break
    if tmp % b == c:
        print("YES")
        break

    s.add(a%b)
    tmp += a

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

a, b, c = map(int, sys.stdin.readline().split())

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

if __name__ == '__main__':
    ans = main()
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
rest = set([])
for i in range(a, 1000 * a, a):
    rest.add(i % b)
if c in rest:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
a=[A*(i+1)%B for i in range(B)]
if C in a:
    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+1) % B == C:
        print("YES")
        exit()
print("NO")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
exit=0
for i in range(a): #a=40なら40回繰り返せば、余りは一周する
    num=b*i+c
    if num%a==0:
        exit=1
        break
print("YES" if exit==1 else "NO")

Submission status: Accepted

Solution code:
import fractions

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print('NO')

Submission status: Accepted

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

OK_list = []

for i in range(B):
    OK_list.append(A*i % B)

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

Submission status: Accepted

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

from fractions import gcd
g = gcd(a, b)
if g == 1:
    print('YES')
elif c % g == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

yo=[0]*100

i=1
while True:
    temp=(A*i)%B
    if temp==C:
        print("YES")
        exit()
    else:
        if yo[temp]==0:
            yo[temp]=1
        else:
            print("NO")
            exit()
    i+=1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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:
ABC = list(map(int,input().split()))
A=ABC[0]
B=ABC[1]
C=ABC[2]

cnt=1
summary=0
tmp=[]
flag=False
while True:
    summary=cnt*A
    cnt=cnt+1
    if summary%B in tmp:
        break
    else:
        tmp.append(summary%B)
    
    if summary%B==C:
        flag=True
        break

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

Submission status: Accepted

Solution code:
a,b,c = map(int, input().split())
ans=0
for i in range(101):
    if (a*i-c)%b==0:ans=1

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

Submission status: Accepted

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

def gcd(p, q):
    if q == 0:
        return(p)
    else:
        return gcd(q, p % q)
if c % gcd(a, b) == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def check():
    num = set()
    A,B,C = map(int, input().split())
    
    for i in range(B):
        amari = A*i % B
        if amari == C:
            return 'YES'
        if amari in num:
            break
        num.add(amari)
    return 'NO'
  
print(check())

Submission status: Accepted

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

for b in range(1, B + 1):
    if (A * b) % B == C:
        ans = "YES"
        break

print(ans)

Submission status: Accepted

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

def Choose(A, B, C):
    if A == 1:
        return 'YES'
    for i in range(B):
        if C == (A * i) % B:
            return 'YES'
    return 'NO'

print(Choose(A, B, C))

Submission status: Accepted

Solution code:
from sys import stdin

a,b,c = [int(x) for x in stdin.readline().rstrip().split()]

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

Submission status: Accepted

Solution code:
# A%B,2A%B,3A%B.....
#(k + b)a % b = (k * a + b * a) % b = k * a % b
a,b,c = map(int,input().split())
ans = "NO"
for i in range(a,a*b,a):
  if i % b == c:
    ans = "YES"
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = [int(i) for i in input().split()]
i = 1
mod = []
while True:
  m = a * i % b
  if m == c:
    print("YES")
    break
  if m in mod:
    print("NO")
    break
  mod.append(m)
  i += 1

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())
for i in range(B):
  if A*i%B==C:
    print('YES')
    break
  elif i ==B-1:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    a,b,c = MI()
    d = a%b
    res = d
    for i in range(b**2):
        if c == res:
            print("YES")
            exit()
        res+=d
        res%=b
    print("NO")
    
if __name__ == '__main__':
    main()

Submission status: Accepted

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

a = 0
flag = 0
for i in range(B+1):
    a+=A
    if a%B == C:
        flag = 1
        break
        
if flag == 0:
    print("NO")
else:
    print("YES")

Submission status: Accepted

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

Solution code:
from fractions import gcd

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())

seen = {}
find_flag = 0
for i in range(1, 100):
    rest = A * i % B
    if rest == C:
        find_flag += 1
        break
    if seen.get(rest):
        break
    else:
        seen[rest] = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'NO'
	
for i in range(200):
	if (a*i-c)%b == 0:
		ans = 'YES'

print(ans)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
x=1
count=0
for i in range(10**4):
    if x*a-((x*a)//b)*b==c:
        print('YES')
        break
    else:
        x+=1

if x==10**4+1:
    print('NO')

Submission status: Accepted

Solution code:
# atcoder : python3 (3.4.3)
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)
mod = 10**9+7

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

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

print(ans)

Submission status: Accepted

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

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

print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
cnt = 0
for i in range(1, b + 1):
    if (a * i) % b == c:
        cnt += 1

print('YES' if cnt >= 1 else 'NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
dp=[False]*b
aa=a
while True:
  if not dp[aa%b]:
    dp[aa%b]=True
    aa+=a
  else:
    break
print(("NO","YES")[dp[c]])

Submission status: Accepted

Solution code:
""" sum(kA)%B = C"""
a,b,c = map(int,input().split())
mod = []
k=0
s = a
while(k<100):
    if s%b == c:
        print("YES")
        exit()
    k+=1
    s=k*a
    if k>=100:
        print("NO")
        exit()

Submission status: Accepted

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

Submission status: Accepted

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

N=[]
x=0
while True:
    if x%b not in N:
        N.append(x%b)
    else:
        break
    x=x+a
    
if c in N:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

for i in range(a, b*a, a):
  if i % b == 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*a % b==c:
        print("YES")
        exit()
print('NO')