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())
flag = False
for i in range(b):
  if (a*i)%b == c:
    print('YES')
    flag = True
    break
if flag == False:
  print('NO')

Submission status: Accepted

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

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

Submission status: Accepted

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

ok = False
for x in range(200):
  if (A * x) % B == C:
    ok = True
    
if ok:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys, math, fractions, itertools

MOD = 5  # type: int
YES = "YES"  # type: str
NO = "NO"  # type: str

def solve(A: int, B: int, C: int):
    flag = False
    for i in range(B):
        if i * A % B == C:
            flag = True
    if flag:
        print('YES')
    else:
        print('NO')
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    solve(A, B, C)

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
def solve():
    a, b, c = read()
    result = think(a, b, c)
    write(result)


def read():
    return read_int(3)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b, c):
    m_seed = a % b
    while m_seed >= b:
        m_seed %= b

    visited = set()
    m_accumulated = m_seed
    while True:
        if m_accumulated == c:
            return True
        if m_accumulated in visited:
            return False
        visited.add(m_accumulated)
        m_accumulated += m_seed
        while m_accumulated >= b:
            m_accumulated %= b


def write(result):
    if result:
        print('YES')
    else:
        print('NO')


if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())
s = 0 
for i in range(101):
    s += i
check = 0
for i in range(5051):
    if (A * i  - C ) % B == 0:
        check = 1

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

Submission status: Accepted

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

Submission status: Accepted

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

for j in range(100):
    if((x*j) % y == z):
        print("YES")
        a = 0
        break

if(a == 1):
    print("NO")

Submission status: Accepted

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

Submission status: Accepted

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


main()

Submission status: Accepted

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

cur_sum = 0
for _ in range(2 * B):
    cur_sum += A
    if (cur_sum % B == C):
        print("YES")
        exit(0)
print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(z)

Submission status: Accepted

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

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

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

Submission status: Accepted

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

while True:
    
    if d%b==c:
        print("YES")
        exit()

    elif d%b not in jol:
        jol.append(a%b)
        
    else:
        print("NO")
        exit()
    
    d+=a

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A,B,C = map(int, input().split())
ans_list = []
count = 1
while True:
  div_num = A*count
  ans = div_num % B
  if ans in ans_list:
    break
  else:
    ans_list.append(ans)
  count += 1
if C in ans_list:
  print("YES")
else:
  print("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
d = a
e = []
while True:
    if d % b == c:
        print("YES")
        exit()
    else:
        if d % b not in e:
            e.append(d % b)
        else:
            print("NO")
            exit()
        d += a

Submission status: Accepted

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

import sys

sys.setrecursionlimit(10**7)

# Override `input` function because `stdin.readline()` is 10x faster than built-in `input()`
input = sys.stdin.readline


def read_h(typ=int):
    return list(map(typ, input().split()))


def read_v(n, m=1, typ=int):
    return [read_h(typ) if m > 1 else typ(input()) for _ in range(n)]


def main():
    a, b, c = read_h()

    mod = set((a * i) % b for i in range(1, b + 1))
    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())

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

print("NO")

Submission status: Accepted

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

  print(result)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a, b, c = LS()
    if a[-1] == b[0] and b[-1] == c[0]:
        print("YES")
    else:
        print("NO")
    return

#B
def B():
    a, b, c = LI()
    for i in range(1, b):
        if a * i % b == c:
            print("YES")
            return
    print("NO")
    return

#C
def C():
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

    print('NO')


if __name__ == "__main__":

    main()

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
print('YNEOS'[c not in [a*i%b for i in range(b)]::2])

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
d = {}
e = 1
while True:
    if e * a % b not in d:
        d[e * a % b] = 0
        e += 1
    else:
        if c in d:
            print("YES")
        else:
            print("NO")
        exit()

Submission status: Accepted

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

res = False
a = A
while a < B * A:
    if a % B == C:
        res = True
        break
    a += A

print('YES') if res else print('NO')

Submission status: Accepted

Solution code:


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

    dataset = set()
    for i in range(2, 100000):
        now_amari = (a * i) % b
        dataset.add(now_amari)

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



if __name__ == '__main__':
    main()

Submission status: Accepted

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

R = set()
m = 1
while (a * m) % b not in R:
    R.add((a * m) % b)
    m += 1
    a %= b

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

Submission status: Accepted

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

kouyaku=fractions.gcd(a,b)
#cがとりうる値を列挙
c_l=[]
for i in range(int(b/kouyaku)):
    c_l.append(i*kouyaku)
if c in c_l:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

#とりあえずコーナーケース考える
if b==0:
    print("NO")
elif a==0 and c!=0:
    prnt("NO")
elif a==1 or c==0:
    print("YES")
elif a==c:#c<bだからa<bがいえる
    print("YES")
elif a==b and c!=0:
    print("NO")
elif a==b and c==0:
    print("YES")
    
else:
    #a,bの最大公約数を求める
    kouyaku=fractions.gcd(a,b)
    #cがとりうる値を列挙
    c_l=[]
    for i in range(int(b/kouyaku)):
        c_l.append(i*kouyaku)
    if c in c_l:
        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:
row = list(map(int, input().split()))
Flag = False
for i in range(1000000):
    if row[0]*i % row[1] == row[2]:
        Flag = True
        break
if Flag:
    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, B + 1):
    if i * A % B == C:
        print('YES')
        exit(0)
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())

R = []
sum = A
while True:
    r = sum % B
    if r == C:
        print('YES')
        break
    if r in R:
        print('NO')
        break

    R.append(sum % B)
    sum += A

Submission status: Accepted

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

r1 = a % b
r0 = c % b

r = r1
while True:
    if r == r0:
        print("YES")
        break
    r = (r + r1) % b
    if r == r1:
        print("NO")
        break

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:

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

lis = []
ans = ""
now = A % B

while True:

    if now == C:
        ans = "YES"
        break

    if now in lis:
        ans = "NO"
        break

    lis.append(now)
    now += A
    now = now % B

print (ans)

Submission status: Accepted

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

if mod == c:
    print("YES")
else:
    i = 2
    flag = 0
    while (mod*i)%b != mod:
        if (mod*i)%b == c:
            flag = 1
            break
        i += 1
    if flag == 1:
        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(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 i * a % b == c:
		print("YES")
		exit()
print("NO")

Submission status: Accepted

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

check = []
i = 1
while True:
    a = A * i % B
    if a == C:
        print("YES")
        exit()
    if a in check:
        break
    else:
        check.append(a)
    i += 1

print("NO")

Submission status: Accepted

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

sum = 0

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

print("NO")

Submission status: Accepted

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

for i in range(10000):
  if i%a[0]==0 and i%a[1]==a[2]:
    b = "YES"
else:
  print(b)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = [int(s) for s in input().split()]
print('YNEOS'[C not in [A * (i + 1) % B for i in range(B)]::2])

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
cond = True
while cond:
    mod = a%b
    if mod != 0:
        a = b
        b = mod
    else:
        cond = False
if c%b == 0:
    print('YES')
else:
    print("NO")

Submission status: Accepted

Solution code:
from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, x  = map(int, input().split())
sum = 0
status = "NO"
for i in range(101):
  if (a * i) % b == x:
    status = "YES"
print(status)

Submission status: Accepted

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

    for i in range(A, A * B, A):
        if (i % B == C):
            print("YES")
            return

    print("NO")

resolve()

Submission status: Accepted

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

num = []
for i in range(1, B+1):
    num.append((i * A) % B)

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

Submission status: Accepted

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

#for i in range(1, 101):
mods = list()
i = 1
while(True):
    #print("A * i = " + str(A * i) + ", mod = " + str((A * i) % B))
    mod = (A * i) % B
    if (mod == C):
        print("YES")
        break
    elif(mod in mods):
        print("NO")
        break
    else:
        mods.append(mod)
    i += 1

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(300000)

YES = "YES"  # type: str
NO = "NO"  # type: str

def solve(A: int, B: int, C: int):
    ret = NO
    for i in range(1, 1001):
        if (A * i) % B == C:
            ret = YES
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    solve(A, B, C)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

resolve()

Submission status: Accepted

Solution code:
nl = lambda: list(map(int, input().split()))
sl = lambda: input().split()
n = lambda: int(input())
s = lambda: input()

A, B, C = nl()

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

print('NO')

Submission status: Accepted

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

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

Submission status: Accepted

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

from collections import deque
loop = set()
l = deque([(A*i)%B for i in range(1, 150)])
for i in range(150):
    pop = l.popleft()
    if pop == C:
        print("YES")
        break
    if pop in loop:
        print("NO")
        break
    else:
        loop.add(pop)

Submission status: Accepted

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

Submission status: Accepted

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

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 = False

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

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

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
i=A%B
S=set()
while(True):
    if i==C:
        print("YES")
        quit()
    if i in S:
        print("NO")
        quit()
    S.add(i)
    i+=A
    i%=B

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
S = set()
for i in range(1, 10001):
    S.add(A * i % B)

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

Submission status: Accepted

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

# a*y=b*x+c
# y=(b/a)*x+(c/a)
#  =(b*x+c)/a
flag=0
for i in range(10000):
    if (b*i+c)%a==0:
        print('YES')
        break
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

num, div, rem = map(int, input().split())
flag = 0

for i in range(div):
    if num * i % div == rem:
        flag = 1
        print("YES")
        break

if flag == 0:
    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()
  else:
    continue
print("NO")

Submission status: Accepted

Solution code:
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys
import string

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

sys.setrecursionlimit(2147483647)
INF = float("inf")


A, B, C = list(map(int, sys.stdin.readline().split()))
a = A
ok = False
for _ in range(1000):
    ok |= a % B == C
    a += A
if ok:
    print('YES')
else:
    print('NO')

Submission status: Accepted

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

mod = a % b
i = 0
num = []
while mod != 0:
    i += 1
    mod =  (a * i) % b
    num.append(mod)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

i = 1
while True:
    mod = a * i % b
    if mod == c:
        print("YES")
        break
    if i == 1:
        s_mod = mod
    elif s_mod == mod:
        print("NO")
        break
    i += 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')
        break
else:
    print('NO')

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

# aの倍数をbで割ったときに余りがcになればよい
first = a % b
if first == c:
  print("YES")
  exit()

count = 2
while True:
  amari = (count*a) % b
  if amari == first:
    print("NO")
    exit()
  if amari == c:
    print("YES")
    exit()
  else:
    count+=1

Submission status: Accepted

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

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

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

Submission status: Accepted

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

s=a

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

Submission status: Accepted

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

for i in range(B + 1):
    if s % B == C:
        print('YES')
        exit()
    else:
        s += A
        

print('NO')

Submission status: Accepted

Solution code:
import math
def main(a, b, c):
    for i in range(b):
        if (a * i) % b == c:
            print('YES')
            return

    print('NO')

if __name__ == "__main__":
    a, b, c = [int(x) for x in input().split()]
    main(a, b, c)

def test1(capsys):
    inputs = [7, 5, 1]
    out = 'YES'
    main(*inputs)
    captured = capsys.readouterr()    
    assert captured.out == str(out) + '\n'

def test3(capsys):
    inputs = [2, 2, 1]
    out = 'NO'
    main(*inputs)
    captured = capsys.readouterr()    
    assert captured.out == str(out) + '\n'

def test4(capsys):
    inputs = [1, 100, 97]
    out = 'YES'
    main(*inputs)
    captured = capsys.readouterr()    
    assert captured.out == str(out) + '\n'

def test5(capsys):
    inputs = [40, 98, 58]
    out = 'YES'
    main(*inputs)
    captured = capsys.readouterr()    
    assert captured.out == str(out) + '\n'

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())
flg ="NO"
for i in range(b):
    if (a*i)%b == c:
        flg = "YES"
        break
print(flg)

Submission status: Accepted

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

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

print('NO')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
modlist = []
now = A
flag = True
while flag:
	if now%B == C:
		break
	if now%B in modlist:
		flag = False
	else:
		modlist.append(now%B)
	now += A
if flag: print('YES')
else: print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [A, B, C] = list(map(lambda x: int(x), inputs[0].split()))
    first_state = A % B
    state = None
    if first_state == C:
        return "YES"

    sum = A
    while state != first_state:
        sum += A
        sur = sum % B
        if sur == C:
            return "YES"
        state = sur

    return "NO"


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

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:
# https://atcoder.jp/contests/abc060/tasks/abc060_b

import itertools
import collections
import bisect

def main():
    A, B, C = map(int, input().split())
    for c in range(1, B+1):
        if (A * c) % B == C:
            print('YES')
            exit()

    print('NO')


if __name__ == '__main__':
    main()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

rem = set()
a = A
while True:
    r = a % B
    if r in rem:
        break
    rem.add(r)
    a += A

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(answer)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

print(["NO","YES"][B>C and C%gcd(A,B)==0])

Submission status: Accepted

Solution code:
#coding: utf-8

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

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

Submission status: Accepted

Solution code:
A, B, C = list(map(int, input().strip().split(' ')))
tmp = A % B
rest = set()
rest.add(tmp)
for _ in range(B):
    tmp = (tmp + A) % B
    rest.add(tmp)
if C in rest:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
#coding: utf-8

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

for i in range(A*B):
    if(A*i % B == C):
        count = 1
    else:
        print('',end='')

if(count == 1):
    print('YES')
else:
    print('NO')