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:
bai,waru,ama = [int(x) for x in input().split()]
han = "NO"
for i in range(1,10000):
    if bai*i%waru == ama:
        han = "YES"
print(han)

Submission status: Accepted

Solution code:
# from pprint import pprint
# import math
# import collections

# n = int(input())
a, b, c = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))

s = 0
mods = []
while True:
    s += a

    mod = s % b

    if mod == c:
        res = 'YES'
        break
    elif mod in mods:
        res = 'NO'
        break

    mods.append(mod)

print(res)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
x=1
fl=False
while x<b:
  if x*a%b==c:
    fl=True
    break
  x+=1
if fl:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

i = 0
while i < 100:
  if (a*i-c)%b == 0:
    print('YES')
    exit()
  i += 1
print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	B
# CreatedDate:  2020-06-26 15:04:28 +0900
# LastModified: 2020-06-26 15:10:43 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    a, b, c = map(int, input().split())
    for i in range(100):
        if float((a*i-c)/b).is_integer():
            print("YES")
            return
    print("NO")



if __name__ == "__main__":
    main()

Submission status: Accepted

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

import math
N = (A * B) // math.gcd(A, B)

array_A = [0]*N
array_B = [0]*N

for i in range(A, N+1, A):
    array_A[i-1] = 1

for i in range(C, N+1, B):
    array_B[i-1] = 1

possible = 0
for i in range(N):
    possible += array_A[i]*array_B[i]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

Submission status: Accepted

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

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a, b, c = LI()
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())
for i in range(1,10**5):
  if (A*i)%B==C:
    print('YES')
    exit()
print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

lst = []
for i in range(1,100):
    lst.append(A * i)


for i in range(1,3):
    for v in itertools.combinations(lst,i):
        if sum(v) % B == C:
            print('YES')
            exit()
print('NO')

Submission status: Accepted

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

for k in range(1,10001):
  if (k*a-c)%b==0:
    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:
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

a,b,c = iim()
num = a%b

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

Submission status: Accepted

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

resolve()

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 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())
flag = 0
for k in range(1,B+1):
    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())

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

Submission status: Accepted

Solution code:
import sys
# from collections import defaultdict, deque
# import math
# import copy
# from bisect import bisect_left, bisect_right
# import heapq

# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 1000000007

def solve():
    a,b,c = getList()
    for i in range(1, b * 101):
        if (a * i) % b == c:
            print("YES")
            return
    print("NO")
    return
def main():
    n = getN()
    for _ in range(n):
        solve()
if __name__ == "__main__":
    # main()
    solve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import 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(B):
  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(1,1000):
  if (i*b+c)%a==0:
    print('YES')
    exit()
    
print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# Begin Header {{{
from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
# }}} End Header
# _________コーディングはここから！！___________
# ... 最小側の制約も確認した？
# ... オーバーフローしない？
a, b, c = map(int, input().split())
for i in range(1, b+1):
    if (a*i-c)%b: i+=1
    else:
        print("YES")
        exit()
print("NO")

Submission status: Accepted

Solution code:
# Begin Header {{{
from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
# }}} End Header
# _________コーディングはここから！！___________
# ... 最小側の制約も確認した？
# ... オーバーフローしない？
a, b, c = map(int, input().split())
i = 1
while i<=b:
    if (a*i-c)%b != 0: i+=1
    else:
        print("YES")
        exit()
print("NO")

Submission status: Accepted

Solution code:
# Begin Header {{{
from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
# }}} End Header
# _________コーディングはここから！！___________
# ... 最小側の制約も確認した？
# ... オーバーフローしない？
a, b, c = map(int, input().split())
i = 1
ok = False
while i<=b-1:
    if (a*i-c)%b != 0: i+=1
    else:
        ok = True
        break
if ok: print("YES")
else: print("NO")

Submission status: Accepted

Solution code:
# Begin Header {{{
from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
# }}} End Header
# _________コーディングはここから！！___________
# ... 最小側の制約も確認した？
# ... オーバーフローしない？
a, b, c = map(int, input().split())
i = 1
ok = False
while i<=b:
    if (a*i-c)%b != 0: i+=1
    else:
        ok = True
        break
if ok: print("YES")
else: print("NO")

Submission status: Accepted

Solution code:
# Begin Header {{{
from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
# }}} End Header
# _________コーディングはここから！！___________
# ... 最小側の制約も確認した？
# ... オーバーフローしない？
a, b, c = map(int, input().split())
i = 1
ok = False
while i<b+1:
    if (a*i-c)%b != 0: i+=1
    else:
        ok = True
        break
if ok: print("YES")
else: print("NO")

Submission status: Accepted

Solution code:
# Begin Header {{{
from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement
# }}} End Header
# _________コーディングはここから！！___________
# ... 最小側の制約も確認した？
# ... オーバーフローしない？
a, b, c = map(int, input().split())
i = 1
ok = False
while i<2*b:
    if (a*i-c)%b != 0: i+=1
    else:
        ok = True
        break
if ok: print("YES")
else: print("NO")

Submission status: Accepted

Solution code:
def main():
    a, b, c = map(int, input().split())
    for num in range(a, 50000, a):
        if num % b == c:
            print('YES')
            return

    print('NO')

if __name__ == "__main__":
    main()

Submission status: Accepted

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

for n in range(10000):
  if n%A==0 and n%B==C:
    a = "YES"

print(a)

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

Submission status: Accepted

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

if A < 0 or A > 100 or B < 0 or B > 100:
    sys.exit()
if not ( C >= 0 or C < B ):
    sys.exit()

tmp = 0
result = "NO"
for I in range(B):
    tmp = A * I % B
    if tmp % B == C:
        result = "YES"

print(result)

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
n = a
mod = []
i = 2
if a == 1:
    print("YES")
    exit()
while True:
    if  a%b not in mod:
        mod.append(a%b)
        a += n
    else:
        print("NO")
        break
    i += 1
    if c in mod:
        print("YES")
        break

Submission status: Accepted

Solution code:
def main():
  a,b,c = list(map(int,input().split()))
  flg=0
  i=0
  while i<=a:
    if (b*i+c) % a==0:
      flg=1
    i+=1
  if flg==1:
    print("YES")
  else:
    print("NO")
  
main()

Submission status: Accepted

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

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(1, b+1):
    k, r = divmod(a*i, b)
    if r == c:
        print('YES')
        break
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
d = a % b
A = {d}
while d != 0:
  d += a
  d %= b
  A.add(d)
print('YES' if c in A else 'NO')

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
remainders=[]
n=1
while True:
    tmp=(A*n)%B
    if not tmp in remainders:
        remainders.append(tmp)
        n+=1
    else:
        break

remainders.sort()
if C==0:
    print("YES")
else:
    if len(remainders)==1:
        print("NO")
    else:
        if remainders[1]==1:
            print("YES")
        else:
            if C%remainders[1]==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')
    exit()
print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int,input().split())
import fractions
g = fractions.gcd(a, b)
if c%g == 0:
    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:
A, B, C = map(int,input().split())
for k in range(1,B+1):
    if (A*k)%B == C:
        print("YES")
        exit(0)
print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def computeGCD(x, y): 
  
   while(y): 
       x, y = y, x % y 
  
   return x 
a,b,c=map(int,input().split())
if c%(computeGCD(a,b))==0:
  print('YES')
else:
  print('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 # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

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()
dic = defaultdict(int)
m = a
while True:
    #print(a)
    if a%b == c:
        print('YES')
        exit()
    if dic[a%b] != 0:
        print('NO')
        exit()
    else:
        dic[a%b] = 1
    a += m

Submission status: Accepted

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions
from operator import itemgetter
import itertools


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
a, b, c = map(int, input().split())
for i in range(10**5):
    ans = a*i
    if ans % 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())
flag = 0
for k in range(1,B+1):
    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 x in range(0,101):
    for y in range(0,101):
        if A * x == B * y + C:
            ans = 'YES'
print(ans)

Submission status: Accepted

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

sum_a = 0

for i in range(1, B+1):
    sum_a = A*i
    if sum_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, 1001):
	if (A*i)%B == C:
		print('YES')
		exit()

print('NO')

Submission status: Accepted

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

res = a%b

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

Submission status: Accepted

Solution code:
A, B, C = list(map(int, input().split()))
rs = []
flag = 0

for i in range(1, int(1e20)):
    r = A * i % B
    if r == C:
        flag = 1
        break
    if r in rs:
        break
    rs.append(r)

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

Submission status: Accepted

Solution code:
#! env python
# -*- coding: utf-8 -*-

import os
import sys


# ac_py.main
# Date: 2020/06/14
# Filename: main 
# Author: acto_mini

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

    # if A % 2 != C % 2:
    #     print("NO")
    #     exit()

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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#! env python
# -*- coding: utf-8 -*-

import os
import sys


# ac_py.main
# Date: 2020/06/14
# Filename: main 
# Author: acto_mini

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

    # if A % 2 != C % 2:
    #     print("NO")
    #     exit()

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

    return


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def main():
    A, B, C = map(int,input().split())
    temp = 1
    for i in range(1, B+1):
        temp = A*i
        if temp%B == C:
            return 'YES'

    return 'NO'

print(main())

Submission status: Accepted

Solution code:
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a,b,c=mi()
for i in range(1,b):
    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(1,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(B):
  if i * A % B == C: 
    print("YES")
    break
else: print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor


# coordinates
dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
a, b, c = map(int, input().split())
for i in range(10**5):
    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(1, 101):
    if i * a % b == c:
        print("YES")
        exit()
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
nums = [int(e) for e in input().split()]
count=0
for i in range(nums[1]):
    if (nums[0]*(i+1))%nums[1]==nums[2]:
        count=1
if count==0:
    print("NO")

else:
    print("YES")

Submission status: Accepted

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

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

ans(a, b, c)

Submission status: Accepted

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

# if a % b == 0 and c != 0:
#     print('NO')
# else:
#     print('YES')

dic = {a%b:0}
now = a
while(1):
    now += a
    if now%b in dic:
        break
    else:
        dic[now%b]= 0

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

Submission status: Accepted

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

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

Submission status: Accepted

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









"""
Aの倍数の集合を考える
s1 = a*1
s2 = a*2
s3 = a*3
・・・



Bで割ってC余る数の集合を考える
k0 = C
k1 = C + B
k2 = C + 2B
k3 = C + 3B
・・・
k999 = c + 999B

k0からk999まで、1000個の整数がひとつもAの倍数でないとしたら、
「Aの倍数ではない」とはつまり
Aで割ると1余る or 
Aで割ると2余る or
Aで割ると3余る or 
・・・
Aで割ると(A-1)余る
つまりパターンとしては A-1 通りしかない

Aで割ったときの余りが
k0 ... 1
k1 ... 3
k2 ... 1






for で回せば,YESの判定はなんとなくできそうだが
NOの判定はどうやればいい？





"""


k = []
result = 'NO'

for i in range(a+1):
    ## Bで割ってC余る数の集合を作る

    k.append(c + b*i)

for i in range(a+1):
    p,q = divmod(k[i],a)   ## Aで割った商と余りを求める
    if q==0:
        result = 'YES'


print(result)

Submission status: Accepted

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

counter = 1
possible_remainders = []


while counter >= 0:
  remainder = (A*counter)%B
  if remainder in possible_remainders:
    break
  else:
    possible_remainders.append(remainder)
    counter += 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
x=0
for i in range(b):
    x+=a
    if x%b==c:
        print('YES')
        x='-1'
        break
if x!='-1':
    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())
d = []
arr = []
for i in range(1, b + 1):
  d.append(i * a)
  arr.append((i * a) % b)
if c in arr:
  print('YES')
else:
  print('NO')

Submission status: Accepted

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

    ans = str()
    x = a

    ans = str()
    for i in range(0, 100):
        if x > a + b:
            break
        if x > b:
            x = x % b
        if x == c:
            ans = "YES"
            break
        if i == 100 - 1:
            ans = "NO"
        ##print(f"{i} times {x} {x+a}")
        x += a
    print(ans)

resolve()

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

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
ls = []
p = a%b
for i in range(1,b+2):
    q = p * i
    if q >= b:
        q %= b
    if q not in ls:
        ls.append(q)
    else:
        break
if c in ls:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

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

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

print(frag)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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