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:
def choose_integers(A: int, B: int, C: int) -> bool:
    n = A
    for _ in range(B):
        n %= B
        if n == C:
            return True
        n = (n + A)
    return False


if __name__ == "__main__":
    A, B, C = map(int, input().split())
    yes = choose_integers(A, B, C)
    print('YES' if yes else 'NO')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
mods = set()
i = 1
while True:
    mod = (A*i)%B
    if mod in mods:
        break
    mods.add(mod)
    i += 1
# 結局, 総和は A の倍数になる
print("YES" if C in mods else "NO")

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

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

Submission status: Accepted

Solution code:
#xa=c(modb)なるx⊂Zはあるか？
#y=xmodb:xa=ya(modb)
#x<b
A,B,C=map(int,input().split())
ans=False
for x in range(B):
	if x*A%B==C:
		ans=True
print('NYOE S'[ans::2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#059 B
import sys
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:
import sys
A,B,C = map(int, input().split())
for i in range(0, B+1):
    if (A*i)%B == C:
        print("YES")
        sys.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())
br = 0
for i in range(100):
    if (i + 1) * a % b == c:
        print('YES')
        br = 1
        break
if br == 0:
    print('NO')

Submission status: Accepted

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

i= 1
m=[]
while True:
    w = (b*i + c) % a
    if w == 0:
        print ("YES")
        break
    elif w in m:
        print ("NO")
        break
    else:
        m.append(w)
        i+=1

Submission status: Accepted

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

Submission status: Accepted

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

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

print('NO')

Submission status: Accepted

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

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


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

Submission status: Accepted

Solution code:

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

total = 0
mod_roop_list = []

def roop_checker(candidate):
    a_str = ''
    candidate_str = ''.join(candidate)
    for can in candidate:
        a_str = a_str + str(can)
        if a_str*5 in candidate_str:
            return True
    else:
        return False

while True:
    total += a
    if total%b == c:
        print('YES')
        break

    mod_roop_list.append(str(total%b))
    if roop_checker(mod_roop_list):
        print('NO')
        break

Submission status: Accepted

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

Submission status: Accepted

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

def gcd(a,b):
    if a%b==0:
        return b
    else:
        return gcd(b,a%b)
    
if C % gcd(A,B) == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
def gcd(a,b):
  if b==0:
    return a
  return 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())

rs = []

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
l=[]
for i in range(1,min(a,b)+1):
  if a%i==0 and b%i==0:
    l.append(i)
if l==[]:
  print("YES")
elif c%l[-1]==0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = list(map(int, input().split()))
amari = A%B
ptn = [amari]
tmp = amari
while 1:
    tmp = (amari + tmp)%B
    if tmp in ptn:
        if C in ptn:
            print('YES')
            exit()
        else:
            print('NO')
            exit()
    else:
        ptn.append(tmp)

Submission status: Accepted

Solution code:
a,b,c = (int(i) for i in 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())
x = max(A,B)
y = min(A,B)
while y != 0: 
  x,y=y,x%y 
if C%x==0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

A,B,C = read_int()

first = A % B

for i in range(1,B+2):
    rem = A*i % B
    if rem == C:
        print('YES')
        break
    elif i != 1 and rem == first:
        print('NO')
        break

Submission status: Accepted

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

for i in range(B):
    if C == i * A % B:
        flag = True

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split());print("NYOE S"[c in[a*s%b for s in range(99)]::2])

Submission status: Accepted

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

a_0 = A % B
a_log = set()

a = a_0
while True:
    if a == C:
        print("YES")
        break
    else:
        if a in a_log:
            print("NO")
            break
        else:
            a_log.add(a)
            a = (a + a_0) % B

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

while(True):
    if(sum%B==C):
        print("YES")
        break
    elif(sum>A*100):
        print("NO")
        break
    else:
        sum += A

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())
sum = 0
while True:
  if sum%B == C:
    print("YES")
    break
  elif sum > A*1000:
    print("NO")
    break
  else:
    sum += A

Submission status: Accepted

Solution code:
#!/usr/bin/python3
# abc060_b
"""
Choose Integers
"""

test = False


def answer():
    """
    Aの倍数の中に条件を満たすものがあるか調べる。
    """
    A, B, C = map(int, input().split())

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


def main():
    """
    main関数
    """
    print(answer())


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

i = 1
ans = "NO"
while True:
    t = (A*i) % B
    if t in r:
        break
    else:
        if t == C:
            ans = "YES"
            break
        else:
            i += 1
            r.add(t)
print(ans)

Submission status: Accepted

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

def main():
	a, b, c = map(int, input().split(" "))
	
	i = 1
	tmp = []
	while True:
		ans = (i * a) % b
		if ans == c:
			print("YES")
			sys.exit()
		i += 1
		
		if ans in tmp:
			print("NO")
			sys.exit()
		tmp.append(ans)
	
if __name__ == "__main__":
	main()

Submission status: Accepted

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

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

print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A, B, C = [int(_) for _ in input().split()]
    #print(A,B,C)
    for i in range(B):
        if (A * i) % B == C:
            print("YES")
            exit()
    print("NO")
    exit()
    
main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
ans = 'NO'
loop = True
cnt = 1
remainder = (B+C)%A
while loop:
    if ((B*cnt)+C)%A == 0:
        ans = 'YES'
        loop = False
    elif (remainder == (((B*cnt)+C)%A)) and (1 < cnt):
        loop = False
    cnt += 1
print(ans)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
d=b
n=0
while 1:
    if (b+c)%a==0:
        print("YES")
        break
    elif n>10000:
        print("NO")
        break
    n+=1
    b+=d

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Thu Mar  7 01:40:39 2019

@author: yuta
"""

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

def main(a,b,c):
    rest = []
    rest.append(a % b) #rest[0]を埋めた
    if rest[0] == c:
        print("YES")
    num = 2
    count = 0
    while ((a*num) % b) != rest[0]:
        rest.append((a*num) % b)
        if (a*num) % b == c:
            count += 1
            break
        else:
            num += 1
    if count == 1:
        print("YES")
    else:
        print("NO")
main(A,B,C)

Submission status: Accepted

Solution code:
a,b,c=[int(i) for i in 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 = 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:
""" AtCoder """

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())
judge = 0

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

if(judge == 0):
  print('NO')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
i = 1
rec = []
while True:
  hoge = (A * i - C) % B
  if hoge == 0:
    print('YES')
    exit()
  i += 1
  if hoge in rec:
    print('NO')
    exit()
  else:
    rec.append(hoge)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from itertools import product

a, b, c = list(map(int, input().split()))
aset = {(a * i) % b for i in range(0, b)}

TheNumberOfElementsIn_aset = 0

while TheNumberOfElementsIn_aset != len(aset):
    TheNumberOfElementsIn_aset = len(aset)
    for element1, element2 in product(aset, aset):
        aset.add((element1 + element2) % b)


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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())


#n = ip()                              #入力整数1つ
#n,m= (int(i) for i in input().split())      #入力整数横2つ
a,b,c = (int(i) for i in input().split())    #入力整数横3つ
#n,a,b,c= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)
#a=[input() for i in range(h)]
#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
d = a
for i in range(100):
    if a%b == c:j(1)
    a+=d
j(0)

Submission status: Accepted

Solution code:
# coding: utf-8
A, B, C = map(int, input().split())
mod = [A % B]
i = 1
while True:
    i += 1
    if mod[0] * i % B not in mod:
        mod.append(mod[0] * i % B)
    else:
        break
print(['NO', 'YES'][C in mod])

Submission status: Accepted

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

Submission status: Accepted

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


main()

Submission status: Accepted

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

a, b, c = [int(i) for i in input().split()]
d=gcd(a,b)
if c % d == 0:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

print('NO')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(B):
  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(1,A*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(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())
def gcd (x,y):
    X = max(x,y)
    Y = min(x,y)
    if Y == 0:
        return X
    else:
        return gcd(Y,X%Y)

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

Submission status: Accepted

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

ab = gcd(a, b)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(x,y):
  if y==0:
    return x
  else:
    return gcd(y,x%y)
a,b,c=map(int,input().split())
if gcd(b,c)%gcd(a,b)==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
if flag:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

for i in range(1,b+1):
    multi_list.append(i*a%b)
    
if c in multi_list:
    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:
def gcd(a, b):
  return a if b == 0 else gcd(b, a % b)

A, B, C = [int(x) for x in input().split()]

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

Submission status: Accepted

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

for i in range(A, A * B + 1):
    if i % A == 0 and 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())

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

Submission status: Accepted

Solution code:
list=input()
list=list.split()
list=[int(i) for i in list]
A=list[0]
B=list[1]
C=list[2]
Sum=A
flag=True
rem=A%B
while Sum%B!=C:
    Sum+=A
    if Sum%B==rem:
        flag=False
        break
if flag:
    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):
  if (a * i) % b == c:
    ans = 'YES'
    break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
opened = []
x = 1
while True:

    if (A * x) % B == C:
        print('YES')
        exit(0)
    else:
        if (A * x) % B in opened:
            print('NO')
            exit(0)
        opened.append((A * x) % B)
        x += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
temp = input().rstrip().split(" ")
A = int(temp[0])
B = int(temp[1])
C = int(temp[2])
flag = 0
if A == B and C > 0:
    print("NO")
elif A == 1:
    print("YES")
elif A + C == B:
    print("YES")
else:
    for i in range(1,10000):
        if (A * i) % B == C:
            print("YES")
            flag = 1
            break
    if flag == 0:
        print("NO")

Submission status: Accepted

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

ok = 0

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

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

Submission status: Accepted

Solution code:
from fractions import*;a,b,c=map(int,input().split());print('YNEOS'[c%gcd(a,b)>0::2])

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
x=1
data=set()
now=0
while x==1:
    now+=a
    now%=b
    if now==c:
        print('YES')
        break
    if now in data:
        print('NO')
        break
    data|={now,}

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
cnt = 0
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())
A = {k*a % b for k in range(b)}
print("YES" if c in A else "NO")

Submission status: Accepted

Solution code:
def func():
    pass


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
def gcd(x, y):
  while(y > 0):
    x, y = y, x % y
  return x
g = gcd(a, b)
if ((g == 1) | (c % g == 0)):
  print('YES')
else:
  print('NO')

Submission status: Accepted

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

ans = 'NO'
from fractions import gcd
for i in range(a, a * b // gcd(a, b), a):
    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, b + 1):
    if (a * i) % b == c:
        ans = 'YES'
        break
    else:
        ans = 'NO'
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


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


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# ABC 060
# 基本
import math
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def getIntFromRows(n): return [int(input()) for i in range(n)]
def getIntMat(n):
    mat = []
    for i in range(n): mat.append(getIntList())
    return mat

def zeros(n): return [0 for i in range(n)]
def zeros2(n, m): return [[0 for i in range(m)] for j in range(n)]
N1097 = 10**9 + 7 

debug = True
def db(x): 
    if debug: print(x)
debug = False

a,b,c = getIntList()
rm = a % b
rslt = 'NO'
for i in range(b+1):
    if a%b==c:
        rslt = 'YES'
        break
    a += rm
db(a)
print(rslt)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

def check(A, B, C):
    return any((i * B + C) % A == 0 for i in range(A))

if check(A, B, C):
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

def check(A, B, C):
    for i in range(A):
        x = i * B + C
        if x % A == 0:
            return True
    return False

if check(A, B, C):
    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")