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"
for i in range(1,102):
    if (A*i) % B == C:
        ans = "YES"
        break
print(ans)

Submission status: Accepted

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

mods = []

tmp = a

while True:
    mod = tmp % b
    if mod not in mods:
        mods.append(mod)
        tmp += a
    else:
        break

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

Submission status: Accepted

Solution code:
from math 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())
flag = 0
for k in range(B):
    if (k*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 = "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, 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+1):
    if (a*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,101):
    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, 200):
    if a*i % b == c:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

Solution code:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b, c = M()
ans = 'NO'
for i in range(1, 101):
    if (a*i)%b==c:
        ans = 'YES'
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(b):
    r = (r+a)%b

    if (r == c):
        print("YES")
        exit()

print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C = (int(T) for T in input().split())
Flag = False
for T in range(1,B+1):
    if (T*A)%B==C:
        Flag = True
print(['NO','YES'][Flag])

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#9
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 = list(map(int, input().split()))
i = 1
d_set = set()
while(True):
    d = A*i % B
    if d == C:
        print('YES')
        break
    if d in d_set:
        print('NO')
        break
    d_set.add(d)
    i += 1

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(m,n):
    if  m%n == 0:
        return n
    return gcd(n,m%n)

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 = [int(x) for x in input().split()]
i = temp = 0
temp_set = set()
ans = "NO"
while temp not in temp_set:
    temp_set.add(temp)
    if temp == c:
        ans = "YES"
        break
    i += 1
    temp = (a * i) % b
print(ans)

Submission status: Accepted

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

print("NO")

Submission status: Accepted

Solution code:
a,b,c=list(map(int,input().split()))
flag=0
for itr in range(1,100000):
    if (a*itr)%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()]
rem = set()
for i in range(1,B+1):
    rem.add((A*i)%B)
print("YES" if C in rem else "NO")

Submission status: Accepted

Solution code:

#!/usr/bin/python
# -*- coding: utf-8 -*-

import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(input())
    return x

def int_map():
    return map(int,input().split())

def int_list():
    return list(map(int,input().split()))

A,B,C = int_map()

l = set()

for i in range(0,B+1):
    l.add((A*i)%B)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

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

M = []
for i in range(1,100+1):
    if (A*i)%B in M:
        break
    else:
        M.append((A*i)%B)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B, C = map(int, readline().split())

    for n in range(1, B):
        if n * A % B == C:
            print('YES')
            return

    print('NO')
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

r=a%b

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

Submission status: Accepted

Solution code:
from sys import exit

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
amari = []
flag = True
i = 0
FLAG = False
while flag:
  check = b*i+c
  if check % a ==0:
    FLAG = True
    flag = False
  else:
    if 0 == amari.count(check % a):
      amari.append(check%a)
    else:
      flag = False
  i = i + 1
if FLAG:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(100):
    s = B * i + C
    if s % A == 0:
        ans = 'YES'
        break

print(ans)

Submission status: Accepted

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

from math import gcd

g=gcd(a,b)

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

Submission status: Accepted

Solution code:
A,B,C=list(map(int,open(0).read().split()))
modlist=[A%B]
i=2

#あまりのリストを生成
while True:
    divd=A*i
    if divd%B==A%B:
        break
    modlist.append(divd%B)
    i=i+1

for j in modlist:
    if j==0:
        continue
    if C%j==0:
        print('YES')
        break
    else:
        C=C%j
else:
    print('NO')

Submission status: Accepted

Solution code:
def main():
    a,b,c=map(int,input().split())
    sumi = set()
    for i in range(10**9):
        x = a*i%b
        if x in sumi:
            break
        elif x == c:
            print("YES")
            return
        else:
            sumi.add(x)
    print("NO")
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

startR = A % B
i = 1
while True:
    R = A*i % B
    if R == C:
        print("YES")
        break
    if i != 1:
        if R == startR:
            print("NO")
            break
    i += 1

Submission status: Accepted

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

startR = A % B
i = 1
while True:
    
    R = A*i % B
    if R == C:
        print("YES")
        break
    
    if i != 1:
        if R == startR:
            print("NO")
            break
    
    i += 1

Submission status: Accepted

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

cond = False
for n in range(a, a*b+1, a):
    if n % b == c:
        cond = True
        break

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

Submission status: Accepted

Solution code:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a,b,c = readInts()
ab = a*b
now = a
while now <= ab:
    if now % b == c:
        print('YES')
        exit()
    now += a
print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    a, b, c = map(int, input().split())

    num = 2
    rem = a % b
    if rem == c:
        print('YES')
        sys.exit()
    while True:
        rem_t = (a * num) % b
        if rem_t == c:
            print('YES')
            sys.exit()
        elif rem_t == rem:
            print('NO')
            sys.exit()
        num += 1

if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

print(ans)

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:
#!/usr/bin/env python3
from math import gcd

a, b, c = map(int, input().split())
print("YNEOS"[c % gcd(a, b) > 0::2])

Submission status: Accepted

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


resolve()

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a, b, c = map(int, input().split())

st = a % b

for i in range(2, b + 1):
    ans = a * i % b

    if ans == c:
        print("YES")
        exit()
    elif ans == st:
        print("NO")
        exit()

Submission status: Accepted

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

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

print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C = map(int,input().rstrip().split(" "))
q = 0
for i in range(200):
    q += A
    if q %B == C:
        print("YES")
        break
    if i == 199:
        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(B)) else "NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

from math import gcd

def solve(a,b,c):
  d = gcd(a,b)
  if c % d == 0:
    return "YES"
  else:
    return "NO"



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

if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
import math
A,B,C=map(int,input().split())
if C%math.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, 10**6):
    if A*i % B == C:
        print("YES")
        break
else:
    print("NO")

Submission status: Accepted

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


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


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

Submission status: Accepted

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

a = int(s[0])
b = int(s[1])
c = int(s[2])

check = False

for i in range(b):
    p = a * i
    if p % b == c:
        check = True
        break

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

Submission status: Accepted

Solution code:
# coding: utf-8

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

if 1 <= len(list(filter(lambda x: x == c, map(lambda x: x % b, range(a, a*b, a))))):
    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:
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 i in range(a, a * b + 1, a):
    if i % b == c:
        print("YES")
        break
else:
    print("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
y = False
for i in range(b):
    if (a*i)%b == c:
        y = True

if y:
    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())
aa = []
now = A
T = True
while T:
  if now % B == C:
    print("YES")
    T = False
    quit()
  else:
    if (now % B) not in aa:
      aa.append(now % B)
      now += A
      #print(aa)
    else:
      print("NO")
      quit()

Submission status: Accepted

Solution code:
def solve():
    A,B,C = map(int,input().split())
    for n in range(10**6):
        if n * A % B == C:
            print('YES')
            return
    
    else:
        print('NO')

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

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

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(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(101):
    t=a*i
    if t%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(A, A*B+A, A):
    if i % B == C:
        ans = True
        break
if ans:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

can_choose = True
work = C
while True:
    work += B
    work = work % A
    if work == 0:
        break
    elif work == (C % A):
        can_choose = False
        break

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

Submission status: Accepted

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

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

if ans == True:
    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:
def readinput():
    a,b,c=map(int,input().split())
    return a,b,c

def main(a,b,c):
    amari=[0]*b
    looped=False
    x=a
    while(not looped):
        r=x%b
        if r==c:
            return 'YES'
        if amari[r]>0:
            looped=True
            return 'NO'
        else:
            amari[r]+=1
        x=x+a

if __name__=='__main__':
    a,b,c=readinput()
    ans=main(a,b,c)
    print(ans)

Submission status: Accepted

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

lst=[0]*101
p=a
lst[p]=1
while True:
    if p%b==c:
        print("YES")
        break
    p+=a
    p%=b
    if lst[p]==1:
        print("NO")
        break
    lst[p]=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(0)

print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

#%%
m = 1
while True:
    if (A * m) % B == 0:
        ans = 'NO'
        break
    elif (A * m) % B == C:
        ans = 'YES'
        break
    m += 1

print(ans)

Submission status: Accepted

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

for n in range(100):
    if (B*n+C)%A==0:
        print('YES')
        exit()
    else:
        continue
print('NO')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

import math
from sys import stdin
input = stdin.readline


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

  print("NO" if C % math.gcd(A, B) else "YES")


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

Submission status: Accepted

Solution code:
import sys
A,B,C = map(int,input().split())
#ln = 100//A+1
for i in range(1,100):
    if (A*i-C)% B == 0:
        print('YES')
        sys.exit()
print('NO')

Submission status: Accepted

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

for n in range(1,100):
  if A*n%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, 1000):
    if A*i % B == C:
        ans = 'YES'
        break
print(ans)

Submission status: Accepted

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

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())
#GCD of a,b
gcd=1
for i in range(2,100):
    if a%i==0 and b%i==0:
        gcd=max(gcd,i)
#print(gcd)
if c%gcd==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.read
from math import gcd
def main():
    a, b, c = map(int, input().split())
    gac = gcd(a, -b)
    if c % gac == 0:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()

Submission status: Accepted

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

def gcd(a,b):
  if b == 0:
    return a
  else:
    return gcd(b,a%b)
  
A,B = (A,B) if A>B else (B,A)
g = gcd(A,B)

if C%g==0:
  print('YES')
else:
  print('NO')

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

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

# Ax = By + C
# ⇄ Ax - By = C
# を満たすx, yが存在する
# CがGCD(A, B)の倍数であることが条件

# 最大公約数をユークリッドの互除法で求める
def GCD_by_euclid(x, y):
    if y == 0:
        return x
    else:
        return GCD_by_euclid(y, x % y)

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
i = 1
flag = False
while(A*i < A*B):
    if A*i%B == C:
        flag = True
        break
    i+=1

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

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(500000)

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

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

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

Submission status: Accepted

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

Submission status: Accepted

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

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy

## input

# N=int(input())
# A,B,C,D=map(int, input().split())
# S = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]
#    S = []
#    for _ in range(N):
#        S.append(list(input()))

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


for i in range(1,100):
    if (A*i)%B == C:
        print("YES")
        sys.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())
d = a * b
e = a

while e <= d:
    if e % b == c:
        break
    else:
        e += a

if e > d:
    print('NO')
else:
    print('YES')

Submission status: Accepted

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

Submission status: Accepted

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

while A*B >= A*k:
  if A*k % B == C:
    flag = True
  k += 1

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

Submission status: Accepted

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

for i in range(1,B+1):
    D = i*A % B
    if D == C:
        Flag = True
        break

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

Submission status: Accepted

Solution code:
def main():
    a, b, c = map(int, input().split())
    mod = []
    mul_a = a
    while True:
        if mul_a % b == 0:
            break
        else:
            mod.append(mul_a % b)
            mul_a += a

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

ans = ''

if a % b == 0:
    if c == 0:
        ans = 'YES'
    else:
        ans = 'NO'
else:
    k = a % b
    for x in range(101):
        if (k * x) % b == c:
            ans = 'YES'
            break
    else:
        ans = 'NO'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

ka = a
m = ka % b
while True:
    if ka % b == c:
        print('YES')
        exit(0)
    ka += a
    if ka % b == m:
        break
print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
A, B, C = map(int, input().split())
N = A
while N < A * B:
    if N % B == C:
        print('YES')
        sys.exit()
    N += A
print('NO')

Submission status: Accepted

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

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:
# ABC060_B
A, B, C = map(int, input().split())

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

print(res)

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:
## B - Choose Integers
A,B,C = map(int, input().split())
for i in range(101):
    if ( (A % B) * i ) % B == C:
        print('YES')
        break
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

A, B, C = map(int, input().split())
i = 1
while (A*i)%B != C:
    i += 1
    if i > 100:
        print('NO')
        sys.exit()
print('YES')

Submission status: Accepted

Solution code:
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

a,b,c = readInts()

i = a
his = []
while 1:
  if i%b==c:
    print("YES")
    exit()
  else:
    if i%b in his:
      print("NO")
      exit()
    else:
      his.append(i%b)
      i+=a