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 bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    A,B,C=map(int,input().split())
    def main():
        for i in range(10**4):
                if i*A%B==C:
                    return 'YES'
        return 'NO'
    print(main())

resolve()

Submission status: Accepted

Solution code:
# aの倍数の総和をbで割ったあまりがcになる
# aの倍数の総和はaの倍数なので
# c = na % b を満たすnがあるかどうか調べる

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:
## coding: UTF-8
from fractions import gcd
s = input().split()
t = [int(p) for p in s]
#print(t)

A = t[0]
B = t[1]
C = t[2]

#print(A)
#print(B)
Gcd = gcd(A, B)
#print(Gcd)

#print(C)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c = [int(i) for i in input().split()]
ans = 'NO'
for i in range(b):
  if (a+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:
# https://atcoder.jp/contests/abc060/tasks/abc060_b

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

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

print('NO')

Submission status: Accepted

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

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

    return print('NO')

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

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]=list(map(int,input().split()))
ans="NO"
for i in range(b):
    if (i+1)*a%b==c:
        ans="YES"
        break
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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


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


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


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:
import fractions
A,B,C=map(int,input().split())
lcm = A*B#//fractions.gcd(A,B)
#A*(i+j)%B=C
#A*(i+j)=BX+C
i=A
while i<=lcm:
  #print(i,lcm)
  if i%B==C:
    print("YES")
    exit()
  i+=A
print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

#if a % 2 == 0:
#    print("NO")
#else:
for i in range(1,b+1):
    l.append((a * i) % b)

if l.count(c) != 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
from fractions import gcd

def main():
    mod=10**9+7
    a,b,c=MI()
    d=gcd(a,b)
    if c%d==0:
        print("YES")
    else:
        print("NO")

main()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(x, y):
    if x < y:
        x, y = y, x
    while y > 0:
        x, y = y, x % y
    return x

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
mod = []
cnt = 0
val = 0
while cnt == len(set(mod)):
    val += a
    mod.append(val % b)
    cnt += 1
    if val % b == c:
        print('YES')
        exit()
print('NO')

Submission status: Accepted

Solution code:
import sys

input = sys.stdin.readline


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


def read_list():
    return list(read_values())


def func(N, mod):
    F = [1]
    for i in range(1, N + 1):
        F.append(F[-1] * i % mod)
    return F


def inv(a, mod):
    return pow(a, mod - 2, mod)


def C(F, a, b, mod):
    return F[a] * inv(F[b], mod) * inv(F[a - b], mod) % mod


def main():
    A, B, C = read_values()
    # n * A = m * B + C
    for i in range(1, B + 1):
        if (i * A) % B == C:
            print("YES")
            return
    print("NO")


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
import collections

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

def prime_factorize(n):
    arr = []
    while n % 2 == 0:
        arr.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            arr.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        arr.append(n)
    return arr
    
aa = collections.Counter(prime_factorize(a))
bb = collections.Counter(prime_factorize(b))

gcm = 1

if aa != []:
    for i in aa.keys():
        if i in bb.keys():
            gcm *= i ** (min([aa[i], bb[i]]))

if c % gcm == 0:
    print("YES")

else:
    print("NO")

Submission status: Accepted

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

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

print(ans)

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

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

print(result)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(b):
    remainder.append((a*(i+1))%b)
    
print(["NO","YES"][c in remainder])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#ABC060
a,b,c = map(int,input().split())
#a * s =b * q + c
check = False
for s in range(200):
    if (a * s - c) % b == 0:
        print("YES")
        check = True
        break
if check == False:
    print("NO")

Submission status: Accepted

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

checker = {}
d = a
while(True):
    m = (d - c) % b
    checker.setdefault(m, False)
    
    if m == 0:
        print('YES')
        break
    elif checker[m]:
        print('NO')
        break
    else:
        checker[m] = True
        d += a

Submission status: Accepted

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

Submission status: Accepted

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

ans = "NO"

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

#print(a,b,c)

for i in range(a):
    if (i*b+c)%a == 0:
        print('YES')
        break
else:
    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 + c) % b == 0:
        print("YES")
        exit(0)

print("NO")

Submission status: Accepted

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

l=[]
for i in range(b):
    l.append((a*i)%b)
t=0
for i in range(len(l)):
    if l[i]==c:
        t+=1
        break
if t!=0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

def main():
    A, B, C = map(int, input().split())
    if C == 0 or A % B == C:
        print("Yes")
        sys.exit()
    rem = A % B
    i = 2
    ans = "NO"
    while True:
        if (A * i) % B == rem:
            break
        elif (A * i) % B == C:
            ans = "YES"
            break
        i += 1
    print(ans)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    a, b, c = [int(e) for e in input().split()]
    for ai in range(1, b + 1):
        if a*ai % b == c:
            print('YES')
            exit()

    print('NO')


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def main():
    multiple_base, divisor, remainder = map(int, input().split())
    for i in range(multiple_base):
        if not (divisor * i + remainder) % multiple_base:
            print("YES")
            break
    else:
        print("NO")


if __name__ == '__main__':
    main()

Submission status: Accepted

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

s = set()
for i in range(1, b + 1):
    aa = a * i
    amari = aa % b
    if amari in s:
        break
    s.add(amari)

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

Submission status: Accepted

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

ans = "NO"

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
x = a % b
w = x
p = {x}
while True:
    w = (w + x) % b
    if w in p:
        break
    else:
        p.add(w)
if c in p:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

a = 0
t = set()

while True:
    a += A
    a %= B
    if a in t:
        print('NO')
        break
    if a == C:
        print('YES')
        break
    t.add(a)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

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

for i in range(10*10):
    d = a*i
    if d % b == c:
        print("YES")
        break
    else:
        d = -1

if d == -1:
    print("NO")

Submission status: Accepted

Solution code:
# coding: utf-8
a,b,c=map(int,input().split())
Flg=False
for i in range(b+1):
    if a*i%b==c:
        Flg=True
        break
    
if Flg:
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
a, b, c= list(map(int, input().split()))
n = a
while n%b:
    if n%b==c:
        print('YES')
        exit()
    n += a
print('NO') if c else print('YES')

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
def gcd(a, b):
  if a < b:
    a, b = b, a
  while a % b:
    a, b = b, a % b
  return b
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())
for i in range(1000):
  if (b*i+c)%a == 0:
    print("YES")
    exit()
print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=list(map(int,input().split()))
for n in range(101):
    if (a*n) % 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()
    else:
        pass
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:
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())
d = a % b
e = []
for i in range(1,b):
    e.append(d*i % b)

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

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
print('YES' if flag else 'NO')

Submission status: Accepted

Solution code:
def solve(a, b, c):

    def gcd(a, b):
        if a > b:
            a, b = b, a
        while a % b != 0:
            a, b = b, a % b
        return b

    return 'YES' if c % gcd(a, b) == 0 else 'NO'

_a, _b, _c = list(map(int, input().split()))
print(solve(_a, _b, _c))

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
for x in range(10000):
    if a*x%b==c:
        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 num in range(a,10**5,a):
    if num%b==c:
        print("YES")
        exit()
print("NO")

Submission status: Accepted

Solution code:
a,b,c = map(int,input().split())
from fractions import gcd
print('YNEOS'[c%gcd(a,b)>0::2])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A, B, C = [int(x) for x in input().split()]
r_set = set()
i = 1
can = False
while True:
    r = A * i % B
    if r == C:
        can = True
        break
    else:
        if not r in r_set:
            r_set.add(r)
            i += 1
        else:
            break
print('YES') if can else print('NO')

Submission status: Accepted

Solution code:
def GCD(x, y):
    if y == 0:
        return x
    return GCD(y, x % y)

A, B, C = map(int, input().split())
if B > A:
    A, B = B, A
gcd = GCD(A, B)

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

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
x=dict()
a=A
while(1):
    b = a%B
    if b in x:
        break
    else:
        x[b]=1
    a += A

for idx in x:
    if idx ==C:
        print("YES")
        exit()

print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
m = A % B
org = m
m = (m + m) % B
while m != org:
    if m == C:
        print('YES')
        exit(0)
    m = (m + org) % B
print('NO')

Submission status: Accepted

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

flag=False

for i in range(a):
    tmp = b*i+c
    if tmp%a == 0:
        flag=True
        break

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

Submission status: Accepted

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

Submission status: Accepted

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

ans = 0

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

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

Submission status: Accepted

Solution code:
def yn(a,b,c):
    ans = "NO"
    for i in range(a*b):
        if a * i % b == c:
            ans = "YES"

    return ans

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

def func():
    for i in range(a, 10000, a):
        if i % b == c:
            return "YES"

    return "NO"

print(func())

Submission status: Accepted

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

Submission status: Accepted

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

ans = 'NO'
for i in range(1, A[1] + 1):
    if i * A[0] % A[1] == A[2]:
        ans = 'YES'
        
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

x = a % b
i = 1
while i <= b:
  if (x * i) % b == c:
    print('YES')
    quit()
  i += 1
print('NO')

Submission status: Accepted

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a, b, c = MAP()
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())
l = []
mod = -1
i = a

while a % b != 0:
  mod = a % b
  l.append(mod)
  a += i
print("YES" if c in l else "NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#解法に必要な方のモジュール
from fractions import gcd

def pin(type=int):
    return map(type,input().split())

#本番入力
A,B,C=pin()

#処理
print(["YES","NO"][C%gcd(A,B) !=0])

Submission status: Accepted

Solution code:
import fractions
n,m,a=map(int,input().split())
if a%fractions.gcd(n,m)==0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

if c in set(tmp):
    print('YES')
else:
    print('NO')

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
a,b,c = map(int,input().split())
bit = 0
for i in range(1,b+1):
	if a*i % b == c:
		bit = 1
if bit: print("YES")
else: print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
"""
author : halo2halo
date : 30, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

bl = False
for i in range(1, 110):
    if (C + B * i) % A == 0:
        bl = True

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

Submission status: Accepted

Solution code:


def main():
    # 状態がループする
    A, B, C = map(int, input().split())
    flag = False
    for i in range(1, B+1):
        if i * A % B == C:
            flag = True
    if flag:print("YES")
    else:print("NO")


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
b = False
for a in range(1, B):
    if A*a-C >= 0:
        if (A*a-C)%B == 0:
            b = True
print("YNEOS"[not(b)::2])

Submission status: Accepted

Solution code:
A, B, C = [int(i) for i in input().split()]
history = set()
a = A
ans = "NO"
while True:
    r = a % B
    if r in history:
        break
    if r == C:
        ans = "YES"
        break
    history.add(r)
    a += A
print(ans)

Submission status: Accepted

Solution code:
import sys

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

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

print('NO')

Submission status: Accepted

Solution code:
import fractions

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

if gcd == 1 and C != 0 or gcd != 1 and fractions.gcd(gcd, C) != 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 (i * a % b == c):
        result = 'YES'
        break
    else:
        result = 'NO'
print(result)

Submission status: Accepted

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

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

print("NO")

Submission status: Accepted

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 permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

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()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, C = MAP()

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

Submission status: Accepted

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