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

ans = 'NO'
if a < b and c%a == 0:
  ans = 'YES'
else:
  for i in range(1, 100000):
    if (b*i + c)%a == 0:
      ans = 'YES'
      break
  
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())
flag = False
for i in range(10**5):
    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())

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print('NO')

Submission status: Accepted

Solution code:
# ABC 060: B – Choose Integers
a, b, c = map(int, input().split())
canSelect = 'NO'

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

print(canSelect)

Submission status: Accepted

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

flag = 0
for i in range(B+1):
    if (A * i) % B == C:
        flag = 1
    else:
        pass

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

Submission status: Accepted

Solution code:
from sys import stdin

A, B, C = [int(x) for x in stdin.readline().rstrip().split()]

A_mod = A
B_mod = B

while B_mod != 0:
    A_mod = A_mod % B_mod
    if A_mod == 0:
        res_mod = B_mod
        break
    B_mod = B_mod % A_mod
    if B_mod == 0:
        res_mod = A_mod
        break

check = C % res_mod
if check == 0:
    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'
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
import sys,bisect,string,math,time,functools,random
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[];g=[[] for i in range(n)]
    for i in range(E):
        inp=LI();org_inp.append(inp)
        if index==0:inp[0]-=1;inp[1]-=1
        if len(inp)==2:
            a,b=inp;g[a].append(b)
            if not Directed:g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp;aa=(inp[0],inp[2]);bb=(inp[1],inp[2]);g[a].append(bb)
            if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,boundary=1,search=[],replacement_of_found='.',mp_def={'#':1,'.':0}):
#h,w,g,sg=GGI(h,w,boundary=1,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0}) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):return [[tb//(n**bt)%n for bt in range(k)] for tb in range(n**k)]
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)
def show2d(g,h,w):
    for i in range(h):show(g[i*w:i*w+w])

YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
input=lambda: sys.stdin.readline().rstrip()

show_flg=False
show_flg=True

import fractions
a,b,c=LI()
d=fractions.gcd(a,b)
print(YN[c%d!=0])

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
x=input().split(" ")
a=int(x[0])
b=int(x[1])
c=int(x[2])
d=b*c

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
h = {}
ans = "NO"
n = a
while not n % b in h:
    if (n % b) == c:
        ans = "YES"
        break
    h[n % b] = 1
    n += a
print(ans)

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

Submission status: Accepted

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

Submission status: Accepted

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

i = 0
s = 0
while True:
    if A * i % B == C:
        print('YES')
        break
    if A * i % B == 0 and i != 0:
        print('NO')
        break
    i += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
amari=[]
for i in range(0,b):
  if (a*i)%b==c:
    print("YES")
    break
  if (a*i)%b!=c and i==b-1:
    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())

flag = True
for i in range(1, b+1):
    if (a * i) % b == c:
        print('YES')
        flag = False
        break
if flag:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

l = list(map(lambda x:x*a, range(b)))
for i in l:
    if 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, 100):
    if a * i % b == c:
        print("YES")
        exit()

print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


import sys

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

Submission status: Accepted

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

a=a%b
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:
a,b,c=map(int,input().split())
s=[a*i for i in range(1,b+1) if (a*i)%b==c]
print('YES' if len(s)>0 else '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となる整数が存在するか
#Bで割った余りが0からB-1を循環することから
#Aの1倍からAのB倍までをテストすると求まる。



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

for i in range(A, A * B + 1, A):
    if i % B == C:
        flg = True
        break
    else:
        flg = False

print("YES" if flg else "NO")

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
amari=[]
tmp=a
while(True):
    if a%b==c:
        print("YES")
        break
    elif a%b in amari:
        print("NO")
        break
    else:
        amari.append(a%b)
        a+=tmp

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:
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:
x,y,z=map(int,input().split())
def lcd(a,b):
    if b==0: return 1
    else: return lcd(a%b,a)
def gcm(a,b):
    return a//lcd(a,b)*b
m=gcm(x,y)//x
ans=False
for i in range(m):
    if i*x % y==z:
        ans=True
        break
    else:continue
print(["NO","YES"][ans])

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

remain = [0]

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

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

if a % b == 0 or b <= c:
    print('NO')
else:
    r = a % b
    d = fractions.gcd(r, b)
    if d == 1:
        print('YES')
    elif c % d == 0:
        print('YES')
    else:
        print('NO')

Submission status: Accepted

Solution code:
#import itertools
#import fractions
#import numpy as np
#mod = 10**4 + 7
"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""

# Written by NoKnowledgeGG @YlePhan

#import math
#mod = 10**9+7



def main():
  a,b,c = map(int,input().split())
  dic = {}
  ans = 0
  i = 1
  while True:
    ans += a
    a_m = ans % b
    if ans % b == c:
      print('YES')
      exit()
    if not str(a_m) in dic.keys():
      dic[str(a_m)] = 1
    else:
      #print(dic)
      print('NO')
      exit()
    i +=1
  
  
if __name__ == '__main__':
  main()

Submission status: Accepted

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

amari1 = a%b

flg = False
for i in range(b):
  if amari1*(i+1)%b == c:
    flg = True
    
if flg:
  print("YES")
else:
  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:
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(2*B):
  if ((i*A)%B)==C:
    print("YES")
    break
else:
  print("NO")

Submission status: Accepted

Solution code:
import sys

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
rem = a % b
tmp = 0
fa = a
ans = "NO"
if(rem!=0):
    while (tmp != rem):
        a += fa
        tmp = a % b
        if (tmp == c):
            ans = "YES"
            break
else:
    if(c==0):
        ans = "YES"
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())
for i in range(b):
  if i * a % b == c:
    print("YES")
    exit()
print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(10000):
    lis.append(a*i%b)
if c in lis:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

memo = 0
mods = []
i = 1
while True:
    memo = memo + A
    r = memo % B
    if r == C:
        flag = True
        break
    elif r in mods:
        flag = False
        break
    else :
        mods.append(r)
        i += 1
        
if flag:
    print('YES')
else :
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

mod = a % b
is_ok = False
for i in range(b):
    if mod == c:
        is_ok = True
    mod = (mod+a) % b

print("YES" if is_ok else "NO")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
li=[]
for i in range(1000000):
  c=A*(i+1)%B
  if c  in li:
    break
  li.append(c)

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

Submission status: Accepted

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

l=[(a*i)%b for i in range(1,b+1)]

if l.count(c)>=1:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

exist = False
for i in range(1,b+1):

    if i*a % b == c:
        exist = True

if exist:
    print("YES")
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(" "))
Amod = A%B

if Amod==0:
    if C!=0:
        print("NO")
    else:
        print("YES")
else:
    i=0
    while(i<=B):
        i+=1
        c = (i%B * Amod)
        if (c%B==C):
            print("YES")
            break
    if(i>B):
        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:
A,B,C=map(int,input().split())
flag=0
for i in range(1,B+1):
  if i*A%B==C:
    flag=1
    break
if flag==1:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
def input(): return sys.stdin.readline().strip()
def STR(): return input()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
sys.setrecursionlimit(10 ** 9)
inf = sys.maxsize
mod = 10 ** 9 + 7

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

Submission status: Accepted

Solution code:
import sys

A,B,C = map(int,input().split())
for i in range(0,A*B+1,A):
    if i == 0:
        continue
    if i % B == C:
        print("YES")
        sys.exit()
print("NO")

Submission status: Accepted

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

flg = 0

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(1,101):
  if sum % B == C:
    print('YES')
    exit()
  else:
    cnt += 1
    num = A * cnt
    if num % B == C:
      print('YES')
      exit()
    sum += num
  
  if cnt == 100:
    print('NO')
    exit()

Submission status: Accepted

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

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

# 余りはループする。Modを回答するのだって同じだ。

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
baisuu = a
ans = "NO"
i = 0

while baisuu != a * b:
    if baisuu % b == c:
        ans = "YES"
        break
    else:
        i = i + 1
        baisuu = a * i

print(ans)

Submission status: Accepted

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

#for分の繰り返し範囲
#A*B % B=0
#A*(B+1) % B=A
#→繰り返し範囲はA*Bまでで十分

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

Submission status: Accepted

Solution code:
x,y,z=list(map(int, input().split()))

ans=0
chk=0
for i in range(x*y):
	ans=(ans+x)%y
	if ans==z:
		chk=1
if chk==1:
	print('YES')
else:
	print('NO')

Submission status: Accepted

Solution code:
A,B,C=map(int, input().split())
ans=[]
i = 1
while 1:
  x = A * i
  mod = x % B
  if mod == C:
    print("YES")
    exit()
  if mod in ans:
    print("NO")
    exit()
  ans.append(mod)
  i+=1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def f(A, B, C):
    ans = 'NO'
    for k in range(1, B + 1):
        if (k * A % B == C):
            ans = 'YES'
    return ans


if __name__ == "__main__":
    A, B, C = map(int, input().split())
    print(f(A, B, C))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
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
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

a,b,c=mii()

chk=False

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

Submission status: Accepted

Solution code:
# import sys
# import math
# import decimal
# import queue
# import bisect
# import heapq # priolity-queue
# import time
# import itertools
# import collections # queue
# from operator import itemgetter
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    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)
    return

if __name__=='__main__':
    main()

Submission status: Accepted

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

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

print("NO")

Submission status: Accepted

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

d = a % b
A = []

for i in range(1, 1000):
    e = (d * i) % b
    A.append(e)

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

Submission status: Accepted

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

Submission status: Accepted

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

l = []
bool = True
i = 0
while bool:
    l.append(a*i%b)
    i += 1
    if l[0] == l[-1] and len(l) != 1:
        bool = False
        
if l.count(c) > 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

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

print("NO")

Submission status: Accepted

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

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

print("NO")

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

# a % b = c

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = list(map(int,input().split()))
be_c =[]
ans = 0
for i in range(b):
    be_c.append(i*a)
for i in range(b):
    if be_c[i] != 0:
        if be_c[i] % b == c:
            print('YES')
            ans = 1
            break
        else:
            pass
    else:
        pass
if ans == 0:
    print('NO')

Submission status: Accepted

Solution code:
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
a,b,c = map(int,input().split())

checklis = []
i = a
while not i in checklis:
    num = i % b
    if num == c:
        ans = "YES"
        break
    else:
        checklis.append(num)
        if num==0:
            checklis.append(i)
        i = num + a
else:
    ans = "NO"

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する

Submission status: Accepted

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

a, b, c = map(int, input().split())
g = gcd(a, b)
if c % g:
    print('NO')
else:
    print('YES')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import os

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B, C = list(map(int, sys.stdin.readline().split()))

    ret = 'NO'
    for n in range(100):
        if (A * n) % B == C:
            ret = 'YES'

    print(ret)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

i = 0
while True:
    i = i+a
    if i%b == c:
        print("YES")
        break
    else:
        if i%b not in amalist:
            amalist.append(i%b)
        else:
            print("NO")
            break

Submission status: Accepted

Solution code:
A,B,K=map(int,input().split())
t=A
for i in range(B):
    if(t%B==K):
        print("YES")
        exit()
    t+=A
print("NO")

Submission status: Accepted

Solution code:
#abc056 b
a,b,c=map(int,input().split())
num=[]
i=1
n=a
while True:
    n=a*i
    x=n%b
    if x not in num:
        num.append(x)
    else:
        break
    i+=1

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

Submission status: Accepted

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

check = set([])

p = a
i = 1
while True:
    tmp = p%b

    if tmp == c:
        print("YES")
        exit()
    
    if tmp in check:
        print("NO")
        exit()
    check.add(tmp)
    i += 1
    p = a*i

Submission status: Accepted

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

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):
    a = A
    for _ in range(1000):
        if a%B == C:
            print(YES)
            return
        a += A

    print(NO)
    return


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