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:
import sys
import copy
import math
import itertools
import numpy as np

A,B,C = [int(c) for c in input().split()]
a = []
cnt=0
while True:
    cnt+=A
    a.append(cnt%B)
    if C == cnt%B:
        print("YES")
        sys.exit(0)
    elif a.count(cnt%B) >1:
        print("NO")
        sys.exit(0)

Submission status: Accepted

Solution code:
import math

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

if C%x==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
from math import gcd
A, B, C = map(int, input().split())
x = gcd(A, B)
if C % x == 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')
        break
    elif (a * i) % b == 0 and i > 0:
        print('NO')
        break

Submission status: Accepted

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

dic = {}
tmp = A%B
while not(tmp in dic):
    dic[tmp]=0
    tmp = (tmp+(A%B))%B


print("YES" if C in dic else "NO")

Submission status: Accepted

Solution code:
# B - Choose Integers
def main():
    a, b, c = map(int, input().split())


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


if __name__ ==  "__main__":
    main()

Submission status: Accepted

Solution code:
# B - Choose Integers
def main():
    a, b, c = map(int, input().split())


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


if __name__ ==  "__main__":
    main()

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

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

found = False
for n in range(1,101):
  if n*A % B == R:
    found = True
    break
    
if found:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
import math

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

Submission status: Accepted

Solution code:
A, B , C = map(int, input().split())
def gcd(a, b):
	while b:
		a, b = b, a%b
	return a

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right #func(リスト,値)
from heapq import heapify, heappop, heappush
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20

def mint():
    return map(int,input().split())
def lint():
    return map(int,input().split())
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])

a,b,c = mint()
judge(c%gcd(a,b)==0,['YES','NO'])

Submission status: Accepted

Solution code:
#ABC060 B:Choose Integers

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b, c = rm()
len_ = 1
s = set()
s.add(a)
i = a
while len_ == len(s):
    i += a
    i %= b
    len_ += 1
    s.add(i)
for i in list(s):
    if i == c:
        print('YES')
        exit()
else:
    print('NO')

Submission status: Accepted

Solution code:
import sys
a,b,c=map(int,input().split())
i=1
l=[]
while True:
    aa=a*i%b
    if aa in l:
        break
    l.append(aa)
    i+=1
    if aa!=0 and c%aa==0:
        print('YES')
        sys.exit()
print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
#kA%Bの数列になる
#AをBで割ったあまりはB-1以下になる
#(k+B)A%B = (kA+BA)%B = kA%B + BA%B = kA%B
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):
    a = A*i
    if 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,10000):
    a = A*i
    if a % B == C:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

Solution code:
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    def judge():
        for i in range(0, 100000):
            cur = A * i
            if cur % B == C:
                return True
        return False

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
mod=set()
tmp=0
D=A
while tmp not in mod:
    mod.add(tmp)
    tmp=D%B
    if tmp==C:
        print('YES')
        exit()
    D+=A
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"

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:
from fractions import gcd
A, B, C = map(int, input().split())
if C % gcd(A, B) == 0:
	print("YES")
else:
	print("NO")

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
modb = [0]*100
for i in range(1,100000):
    n = a*i
    m = n%b
    # print(n,m)
    if(modb[m] != 0):
        break
    modb[m] = 1

print("YES" if(modb[c] == 1) else "NO")

Submission status: Accepted

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

x = copy.deepcopy(a)
visited = [False] * (b+1)
flg = True
while True:
    x %= b
    if x == c:
        break
    elif visited[x]:
        flg = False
        break
    else:
        visited[x] = True
        x += a
print('YES') if flg 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")
        exit()
print("NO")

Submission status: Accepted

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

n = a
cnt = 1
while cnt <= b:
    if n % b == c:
        print('YES')
        exit()
    cnt += 1
    n += a
print('NO')

Submission status: Accepted

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

flag = True

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

Submission status: Accepted

Solution code:
ans = 'NO'
a, b, c = map(int, input().split())
memo = []
for i in range(1, 10**9):
  tmp = (a * i)%b
  if tmp == c:
    ans = 'YES'
    break
  if tmp in memo:
    break
  else:
    memo.append(tmp)
print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush

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

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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())
s = "NO"
for i in [a * j for j in range(1, b)]:
    if i % b == c:
        s = "YES"
        break

print(s)

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())
i = 0
flag = True
while flag:
  num = b * i
  if (num + c) % a == 0:
    print("YES")
    flag = False
  elif i >= 10**5:
    print("NO")
    break
  else:
    i += 1

Submission status: Accepted

Solution code:
#9 B - Choose Integers AC(hint)
A,B,C = map(int,input().split())

result = 'NO'

num = 0
#(k+B)A%B = (kA + AB)%B = kB
for i in range(1,B+1):
    num = (A*i)%B
    if num == C:
        result = 'YES'
        break
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def zz():
    return map(int,input().split())

a,b,c = zz()
ans = 0
for i in range(1,b+1):
   if (a*i)%b == c:
       ans = 1
       break

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


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


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


A, B, C = zz()
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 = []
for i in range(1, b + 1):
  ans.append((a * i) % b)
print("YES" if c in ans else "NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
x,y,z=map(int,input().split())
l=[]
for i  in range(1,y+1):
    l.append((x*i)%y)
if(z in l):
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")


A,B,C = LI()
ans = False

gcd = math.gcd(A,B)
if C % gcd ==0:
    ans = True

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

Submission status: Accepted

Solution code:
a,b,c = map(int, input().split())
sm=a
x=a%b
sm%=b
if sm==c:
    print("YES")
    exit()

for i in range(10**5):
    sm+=a
    sm%=b
    
    if sm==c:
        print("YES")
        exit()
    elif sm==x:
        break

print("NO")

Submission status: Accepted

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

print("NO")

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    a,b,c = LI()
    reset = set()

    for i in range(b):
        reminder = (a*i)%b
        reset.add(reminder)

    print("YES" if c in reset else "NO")

main()

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
i=1
while A*i<max(A,B)*100:
    if A*i%B==C:
        print("YES")
        break
    i+=1
else:
    print("NO")

Submission status: Accepted

Solution code:
import math

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

d = math.gcd(a, b)

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

Submission status: Accepted

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

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(0)
print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

modd=A%B
for i in range(B):
    if modd*i%B==C:
        print('YES')
        exit()

print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    A, B, C = map(int, input().split())
    lst = [False] * B

    num = 0
    for _ in range(B):
        num += A
        d = num % B

        if d == C:
            flag = True
            break

        if lst[d] == True:
            flag = False
            break

        lst[d] = True

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


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
#
# abc060 b
#

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """7 5 1"""
        output = """YES"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2 2 1"""
        output = """NO"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """1 100 97"""
        output = """YES"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """40 98 58"""
        output = """YES"""
        self.assertIO(input, output)

    def test_入力例_5(self):
        input = """77 42 36"""
        output = """NO"""
        self.assertIO(input, output)


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

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


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
A, B, C = map(int, input().split())

n = 0
for i in range(10**4):
    n += A
    if n % B == C:
        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:
        print("YES")
        break
else:
    print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
N = A % B
M, i = 0, 2
while M != N:
    M = i * N % B
    if M == C:
        print("YES")
        break
    i += 1
else:
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

t = 0
while t != b:
  t += 1
  if a*t%b == c:
    print("YES")
    exit()
print("NO")

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
dp = [-1] * 100
_A = A
while True:
    if A % B == C:
        print("YES")
        break
    if dp[A%B] != -1:
        print("NO")
        break
    dp[A%B] = 1
    A = A % B + _A
    #print(A)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B,C = map(int, input ().split ())
X = A%B
if X == C:
  print ('YES')
else:
  i = 2
  while True:
    x = (i*A)%B
    if x == C:
      print ('YES')
      break
    elif x == X:
      print ('NO')
      break
    i += 1

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
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 math

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

if A // B == 0 & C != 0:
    print("NO")
if C % math.gcd(A,B) != 0:
    print("NO") 
else:
    print("YES")

Submission status: Accepted

Solution code:
import math

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
#t=100//A
#if 100%A==0:
#  t+=1
#d=[A*(i+1) for i in range(t)]
#M=sum(d)
j=0
while j<=10000000:
  if j%B==C:
    print("YES")
    break
  j+=A
else:
  print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

Submission status: Accepted

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

ab = A % B

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

print("NO")

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

# n*a /b >
if (a % 2 == 0 and b % 2 == 0 and c % 2 != 0):
    print('NO')
elif (a % 2 == 0 and b % 2 != 0 and c % 2 == 0):
    print('NO')


else:
    count = 0
    while count < 10 ** 7:
        count += 1
        if ((a * count) % b == c):
            print('YES')
            exit()

    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

def number(a,b,c):
    num=a%b
    sumn=0
    for i in range(2,10000000):
        if sumn==c:
            print("YES")
            return
        sumn+=num
        if sumn>b:
            sumn=sumn%b
    print("NO")
number(a,b,c)

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
m = a % b
f = False
for i in range(m):
    f |= ((i % m * b % m + c % m) % m == 0)

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
for y in range(1,101):
  if ((b * y + c) / a).is_integer():
    print("YES")
    exit(0)
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(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())

n = 0
for i in range(10**6):
    n += a
    n %= b
    if n == 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())

x = A%B
for i in range(B):
    if (x*i)%B==C:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(10**6):
    if A*i%B==C:
        print('YES')
        sys.exit()
    else:
        continue
print('NO')

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [list(input()) for _ in range(n)]


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:
# coding:utf-8
a, b, c = map(int, input().split())

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
ls = [A,B]
ls.sort()
rm = ls[0]
while rm != 0:
    rma = rm
    rm = ls[1] % rm
if C%rma == 0:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import gcd 
a,b,c=map(int,input().split())
if gcd(a,b)==1:
    print("YES")
else:
    g=gcd(a,b)
    print("YES" if c%g==0 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()
dic = defaultdict(int)
start = a
while True:
    if start % b == c:
        print('YES')
        exit()
    if dic[start%b] == 1:
        print('NO')
        exit()
    dic[start%b] = 1
    #print(start%b)
    start += a

Submission status: Accepted

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

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

Submission status: Accepted

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

ans = 'NO'
r = a%b
x = 0
for i in range(100):
    x += r
    if x%b == c:
        ans = 'YES'
        break

print(ans)

Submission status: Accepted

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

first_amari = A%B
next_amari=0
i=2
while(first_amari!=next_amari):
    next_amari = (A*i) % B
    if next_amari == C:
        print("YES")
        exit()
    i+=1

print("NO")

Submission status: Accepted

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