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: Wrong Answer

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

rem = A%B
ans = rem

if ans == 0 and C != 0:
    print("NO")
    exit()

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


print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a==1:
  print("YES")
  exit(0)
d=set()
for i in range(101):
  t=(a*i)%b
  d.add(t)
d=list(d)
s=0
for dd in d:
  s+=dd
  if s%b==c:
    print("YES")
    exit(0)
print("NO")

Submission status: Wrong Answer

Solution code:
def computeGCD(x, y): 
  
    if x > y: 
        small = y 
    else: 
        small = x 
    for i in range(1, small+1): 
        if((x % i == 0) and (y % i == 0)): 
            gcd = i 
              
    return gcd 
a,b,c=map(int,input().split())
r=computeGCD(a,b)
if r%c==0:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
def gcd(x,y):
    while y>0:
        x,y = y,x%y
    return x
A,B,C = map(int,input().split())
a = gcd(A,B)
if C%a==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

for i in range(a, a*b, a):
    if i%b == c:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

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

flg=False


for i in range(10**6):
    
    temp = A*i
    
    if temp%B==C:
        flg=True
        break
        
        
if flg==True:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

for i in range(1000):
    if A*i%B == C:
        print("Yes")
        exit()

print("No")

Submission status: Wrong Answer

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

a%=2
b%=2
c%=2

if a==1:
    print("YES")
else:
    if a==b==c:
        print("YES")
    elif a==b==0 and c==1:
        print("NO")
    elif a==1 and b==c==0:
        print("NO")
    else:
        print("YES")

Submission status: Wrong Answer

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

a%=2
b%=2
c%=2

if a==1:
    print("YES")
else:
    if a==b==c:
        print("YES")
    elif a==b==0 and c==1:
        print("NO")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
import fractions
a, b, c = map(int, input().split())
d = fractions.gcd(a, b)
e = c/d
if float.is_integer(b):
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
from itertools import count

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

for n in count(start=A // C):
    r = (n * A - C) % B
    if r == 0:
        print("Yes")
        break
    else:
        if r not in reminders:
            reminders.append(r)
        else:
            print("No")
            break

Submission status: Wrong Answer

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

result = "NO"
for i in range(B):
    if C == A % B:
        result = "YES"

print(result)

Submission status: Wrong Answer

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

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

print(result)

Submission status: Wrong Answer

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

print("YES" if res == True else "NO")

Submission status: Wrong Answer

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

print("YES" if res == True else "NO")

Submission status: Wrong Answer

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

if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys

readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

for i in range(1, B+1):
    if A * i % B == C:
        print('Yes')
        quit()
print('No')

Submission status: Wrong Answer

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

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

for n in range(a, a*b+1, a):
    if n % b == c:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

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

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

for n in range(1, b+1):
    if n*a % b == c:
        print('Yes')
        exit()
else:
    print('No')

Submission status: Wrong Answer

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

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

rest = a % b
num = a

while True:
    if num % b == c:
        print('Yes')
        exit()
    num+=a
    if num % b == rest:
        print('No')
        exit()

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
import sys
A, B, C = map(int, input().split())
for i in range(1, B):
    if i * A % B == C:
        print('Yes')
        sys.exit()
print('No')

Submission status: Wrong Answer

Solution code:
import sys
A, B, C = map(int, input().split())
for i in range(1, B - 1):
    if i * A % B == C:
        print('Yes')
        sys.exit()
print('No')

Submission status: Wrong Answer

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

ans = False

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

print("Yes") if ans else print("No")

Submission status: Wrong Answer

Solution code:
from fractions import gcd

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

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
L = [0] * b
for i in range(1, b):
    s = (a * i) % b
    if L[s] == 1:
        print('No')
        break
    elif s == c:
        print('Yes')
        break
    else:
        L[s] = 1
else:
    print('No')

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if A == B:
    if C == 0:
        print('YES')
    else:
        print('NO')
elif A > B:
    if C % (A % B) == 0 or (B - C) % (A % B) == 0:
        print('YES')
    else:
        print('NO')
else:
    if (B - C) % A == 0:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if A == B:
    if C == 0:
        print('YES')
    else:
        print('NO')
elif A > B:
    if C % (A - B) == 0 or (B - C) % (A - B) == 0:
        print('YES')
    else:
        print('NO')
else:
    if (B - C) % A == 0:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if A == B:
    print('NO')
elif A > B:
    if C % (A - B) == 0 or (B - C) % (A - B) == 0:
        print('YES')
    else:
        print('NO')
else:
    if (B - C) % A == 0:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

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

sum=A
while sum % B != 0:
    sum = sum + A

    if sum%B==C:
        print("Yes")
        break
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
flag = False
for i in range(B):
    tmp = i*A%B
    if tmp == C:
        flag = True

if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

flag = False

print(C)

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

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

Submission status: Wrong Answer

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

for i in range(b):
    q, r = divmod(a+i, b)
    if r == c:
        print('YES')
        exit()
print('NO')

Submission status: Wrong Answer

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

q, r = divmod(a, b)

if r < c or r == 0:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

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

q, r = divmod(a, b)

if r < c:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
a, b, c = list(map(int, input().split()))
i = 1
while(True):
    if (a * i) % b == 0:
        print('No')
        exit()
    elif (a * i) % b == c:
            print('Yes')
            exit()
    i += 1

Submission status: Wrong Answer

Solution code:
a, b, c = list(map(int, input().split()))
i = 1
while(True):
    if (a * i) % b == 0:
        print('No')
        break
    elif (a * i) % b == c:
            print('Yes')
            break
    i += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
# n*B+C = kAとなるnとkが存在するか
# k = (n*B+C)/A (n,kは整数)
# これを満たすnを順番に調べる。A回繰り返せば必ず1周もしくは答え

n = 0
cnts = [0]*A
while True:
    mod = (n*B+C)%A
    if cnts[mod] == 1:
        print('No')
        break
    if mod == 0:
        print('Yes')
        break
    n += 1
    cnts[mod] = 1

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
def prime_factor(n):
    factors = []
    for i in range(2, int(n**0.5)+1):
        count = 0
        while n % i == 0:
            count += 1
            n /= i
        if count != 0:
            factors.append((i, count))
    if n != 1:
        factors.append((n, 1))
    return factors
a, b, c = map(int, input().split())
ap = prime_factor(a)
ap = sum([[i] * j for i, j in ap], [])
bp = prime_factor(b)
bp = sum([[i] * j for i, j in bp], [])
for i in ap:
    if i in bp:
        bp.remove(i)
d = 1
for i in bp:
    d *= i
if c % d == 0:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

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

cnt = 0
su = a
while cnt < 10:
    if su%b == c:
        print("YES")
        exit()
    su+=a
    cnt+=1
    
print("NO")

Submission status: Wrong Answer

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

cnt = 0
su = a
while cnt < 10:
    if su%b == c:
        print("Yes")
        exit()
    su+=a
    cnt+=1
    
print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
moda=a%b
keep=0
for i in range(1,10**6):
  if (moda*i)%b==c:
    keep=1
    print("YES")
    break
if keep==0:
  print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
moda=a%b
keep=0
for i in range(0,10**6):
  if (moda*i)%b==c:
    keep=1
    print("YES")
    break
if keep==0:
  print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

while a * k < b:
  if a * k % b == c:
    print('YES')
    break
  k += 1
else:
  print('NO')

Submission status: Wrong Answer

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

while a * k < b:
  if a * k % b == c:
    print('YES')
    break
else:
  print('NO')

Submission status: Wrong Answer

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

s = (A - C) // B

for i in range(s, 101):
    if (B * i + C) % A == 0:
        print('Yes')
        break
    if i == 100:
        print('No')

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
n = []
for x in range(b):
    n.append(((x + 1) * a) % b)
    if n[x] > b:
        break
n.sort()
ss = "if (1 in n)"
for q in range(2, b, a):
    ss += "or (({} in n) and (b % {} == 0))".format(q, q, q)
ss += """:
    print("YES")
else:
    print("NO")"""
exec(ss)

Submission status: Wrong Answer

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

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

if ans == 1:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import sys
A, B, C = map(int, sys.stdin.readline().split())
for i in range(1, 101):
    if (A * i) % B == C:
        print("Yes")
        exit()
print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def resolve():
    A, B, C = list(map(int, input().split()))
    print("YES" if abs(A-B) >= C else "NO")
    


if '__main__' == __name__:
    resolve()

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if A%2==0 and C%2==0 or A%2==1 and C%2==1:
    print('YES')
elif A%2!=C%2:
    print('NO')

Submission status: Wrong Answer

Solution code:
def ABC162C(a,b):#ユークリッドの互除法
    while b != 0:
        a %= b
        if a == 0:break
        b %= a
    return max(a,b)

a,b,c=map(int,input().split())
print('YES' if ABC162C(a,b)==ABC162C(b,c) else 'NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

ans = 'NO'
for n in range(1, b+1):
    if (a*n -1) % b == 0:
        ans = 'YES'
        break
print(ans)

Submission status: Wrong Answer

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

if a%2==0 and b%2==0 and c%2==0:
  print("YES")
elif a%2==1 and b%2==1 and c%2==1:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
import sys
# input = sys.stdin.readline
from itertools import accumulate

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

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

main()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

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

Submission status: Wrong Answer

Solution code:
import fractions

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

G = fractions.gcd(A,B)

if C % G == 0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

if x%y == 0 and z != 0:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

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

a2 = 0
while a2 <= b:
    a2 += a
a2 -= b

c0 = set()
a3 = a%b
c0.add(a3)
if a3 == c:
    ans = 'YES'
else:
    ans = 'NO'
while True:
    a3 += a2
    a3 %= b
    if a3 == c:
        ans = 'YES'
        break
    if a3 in c0:
        break
    c0.add(a3)

print(ans)
# print(c0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, C = MAP()

if A % 2 == 0 and B % 2 == 0:
    if C % 2 == 1:
        print("NO")
    else:
        print("YES")
if A % 2 == 1 and B % 2 == 1:
    if C % 2 == 1:
        print("YES")
    else:
        print("NO")
if A % 2 != B % 2:
    if C % 2 == 0:
        print("NO")
    else:
        print("YES")

Submission status: Wrong Answer

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: Wrong Answer

Solution code:
def main():
    import sys
    input = sys.stdin.readline
    A, B, C = map(int, input().split())
    x = A % B
    for _ in range(B):
        x += A
        x %= B
        if x == C:
            print("Yes")
            break
    else:
        print("No")

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
from math import pi, ceil, floor
import numpy as np
from collections import defaultdict, deque
from operator import itemgetter
from bisect import bisect_left, bisect_right, insort_left, insort_right
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(10 ** 6)
# MOD = 10 ** 9 + 7
# INF = float("inf")


def main():
    a, b, c = map(int, input().split())
    num = a
    for i in range(b):
        if num % b == c:
            print("YES")
            exit()
        num += a
    print("NO")


if __name__ == '__main_':
    main()

Submission status: Wrong Answer

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


if __name__ == '__main_':
    main()

Submission status: Wrong Answer

Solution code:
def resolve():
    a, b, c = map(int, input().split())
    a %= b
    for i in range(b):
        if a*i %b == c:
            print("Yes")
            exit()
    print("No")
resolve()

Submission status: Wrong Answer

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

ans ="NO"
if a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
  ans = "YES"
elif a % 2 != 0 and b % 2 != 0 and c % 2 != 0:
  ans = "YES"
elif a % 2 != 0 and b % 2 == 0 and c % 2 != 0:
  ans ="YES"
print(ans)

Submission status: Wrong Answer

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

valid = False
for i in range(0, B):
    if (i * A) % B == C:
        valid = True
        break
if valid:
    print("YES")
else:
    print("N0")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

cand = [(i+1)*A for i in range(B)]
rs = [c%B for c in cand]

print("YES" if 0 in rs else "NO")

Submission status: Wrong Answer

Solution code:
_input = list(map(int, input().split(" ")))
a = _input[0]
b = _input[1]
c = _input[2]

check_limit = a * b
ratio = 1
remain_list = []

while (True):
  remain_list.append(a * ratio % b)
  ratio += 1

  if ratio > b:
    break

if c in remain_list:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a==1 or b==1:
    print("YES")
elif a>=b:
    if c<=a-b:
        print("YES")
    else:
        print("NO")
else:
    if c<=b-a:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split(' '))
i = 1
ans = 'No'
while i < b:
    if (i*a)%b == c:
        ans = 'Yes'
        break
    i += 1
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split(' '))
x = a%b
ans = 'No'
i = 1
while i*x <= c:
    if i*x == c:
        ans = 'Yes'
        break
    i += 1
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if B < C:
    print('NO')
elif A % 2 == 0 and B % 2 == 0 and C % 2 == 1:
    print('NO')
elif A % 2 == 1 and B % 2 == 0 and C % 2 == 0:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
icase=0
from fractions import gcd
#from math import gcd
if icase==0:
    a,b,c=map(int,input().split())
    if gcd(b,c)%gcd(a,b)==0:
        print("Yes")
    else:
        print("No")

Submission status: Wrong Answer

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

for i in range(1, 1001):
    n = i * a
    if n % b == c:
        print('Yes')
        break
else:
    print('No')

Submission status: Wrong Answer

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: Wrong Answer

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

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

ans = 'Yes' if c % gcd(a,b) == 0 else 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=a%b
e=(d*2)%b
i=3
f=[]
f.append(d)
f.append(e)
while e!=d:
  x=d*i
  e=x%b
  i+=1
  f.append(e)

if c in f:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=a%b
e=(d*2)%b
i=3
f=[]
f.append(d)
f.append(e)
while e!=d:
  e=d*i
  e%=b
  i+=1
  f.append(e)

if c in f:
  print('Yes')
else:
  print('No')

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
ok = False
for i in range(1,10**4):
    if a*i %b == c:ok = True
if ok:print('Yes')
else:print('No')

Submission status: Wrong Answer

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

ans = 'NO'
if a < b and c%a == 0:
  ans = 'YES'
else:
  for i in range(1, 10):
    if (b*i + c)%a == 0:
      ans = 'YES'
      break
  
print(ans)

Submission status: Wrong Answer

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

ans = 'NO'
total = 0
if a < b and c%a == 0:
  ans = 'YES'
else:
  for i in range(1, 100000):
    total += a*i
    if total%b == c:
      ans = 'YES'
      break
  
print(ans)

Submission status: Wrong Answer

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

ans = 'NO'
total = 0
for i in range(1, 100000):
  total += a*i
  if total%b == c:
    ans = 'YES'
    break
  
print(ans)

Submission status: Wrong Answer

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

ans = 'NO'
total = 0
for i in range(1, 100000, a):
  total += i
  if total%b == c:
    ans = 'YES'
    break
  
print(ans)

Submission status: Wrong Answer

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

ans = 'NO'
total = 0
for i in range(1, 1000):
  total += a*i
  if total%b == c:
    ans = 'YES'
    break
  
print(ans)

Submission status: Wrong Answer

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

ans = 'NO'
total = 0
for i in range(1, 1000):
  total += a*i
  if total%b == c:
    ans = 'YES'
  
print(ans)

Submission status: Wrong Answer

Solution code:
A, B, C =map(int, input().split())
print('NO' if (A%2==0 and B%2==0 and C%2==1) or (A%2==1 and B%2==0 and C%2==0) or (A%2==0 and B%2==1 and C%2==1) else 'YES')

Submission status: Wrong Answer

Solution code:
A, B, C =map(int, input().split())
print('NO' if (A%2==0 and B%2==0 and C%2==1) or (A%2==1 and B%2==0 and C%2==0) else 'YES')

Submission status: Wrong Answer

Solution code:
# ABC 060: B – Choose Integers
a, b, c = map(int, input().split())
canSelect = 'No'

for i in range(1, b + 1):
    if (i * a) % b == c:
        canSelect = 'Yes'
        break

print(canSelect)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
def divisors(n):
    ans = [1]
    for i in range(1,n//2):
        if n%i == 0:
            ans.append(i)
            if i != n//i:
                ans.append(n//i)
    return ans
aset = set(divisors(A))
bset = set(divisors(B))
if len(aset&bset) != 1:
    if C == 0 or (A < B and C == A):
        print('YES')
    else:
        print('NO')
else:
    print('YES')

Submission status: Wrong Answer

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

for i in range(10**7):
    n = a * i
    if n % b == c:
        print('Yes')
        quit()
print('No')

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a % b == 0 and c != 0:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a % b == 0 and c != 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if a % b == 0 or b <= c:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

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

if a % b == 0:
    print('No')
else:
    print('Yes')

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
for i in range(2*B):
  if ((i*A)%B)==C:
    print("Yes")
    break
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys

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

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

print("Yes") if flag else print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
rem = a % b
tmp = 0
fa = a
ans = "No"
if(rem!=0):
    while (tmp != rem):
        a += fa
        tmp = a % b
        if (tmp == c):
            ans = "Yes"
            break
else:
    if(c==0):
        ans = "Yes"
print(ans)

Submission status: Wrong Answer

Solution code:
## A*n = C mod B
from fractions import gcd


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

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

Submission status: Wrong Answer

Solution code:
## A*n = C mod B
from fractions import gcd


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

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a==1:print('YES')
elif (abs(a-b))%c==0:print('YES')
elif (abs(a-c))%b==0:print('YES')
else:print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a==1:print('YES')
elif a>b and (a%b)%c==0:print('YES')
elif b>a and (b%a)%c==0:print('YES')
else:print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if a%2==1 and b%2==0 and c%2==0 or b%2==1 and a%2==0 and c%2==0 or c%2==1 and b%2==0 and a%2==0:print('NO')
else:print('YES')

Submission status: Wrong Answer

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

if Amod==0:
    if C!=0:
        print("NO")
    else:
        print("YES")
else:
    i=0
    while(i<=B):
        i+=1
        c = (i%B * Amod)
        if (c%B==C):
            print("YES")
            break
    if(i>B):
        print("No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

#for分の繰り返し範囲
#A*B % B=0
#A*(B+1) % B=A
#→繰り返し範囲はA*Bまでで十分

for i in range(A,A*B+1,A):
  if i%B==C:
    print("Yes")
    exit()
print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
def f(A, B, C):
    ans = 'NO'
    for k in range(1, B + 1):
        if (k * A % B == C):
            ans = 'YES'
        return ans

if __name__ == "__main__":
    A, B, C = map(int, input().split())
    print(f(A, B, C))