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())
if a > b:
    a = a%b
if (b-c)%a == 0:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

d=[]
i=1
while 1:
  if (a*i)%b==c:
    print("Yes")
    break
  if d.count((a*i)%b):
    print("No")
    break
  else:
    d.append((a*i)%b)
  i=i+1

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

count = 0
for i in range(1000):
  s = a*i
  if s%b == c:
    count+=1
    break
  else:
    pass

print("Yes" if count>0 else "No")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

nA = A % 2
nB = B % 2
nC = C % 2

if nA == nC:
  print('YES')
elif nA==nB:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:

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

nA = A % 2
nB = B % 2
nC = C % 2

if nA == nC:
  print('YES')
else:
  print('NO')

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(a,b+1)) else "NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

if(t):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if(t):
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

if(((a%2==0 or b%2==0) and c%2==0) or ((a%2==1 or b%2==1) and c%2==1)):
    if((a-b)%2==c%2):
        print('Yes')
    else:
        print('No')
else:
    print('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:
a, b, c = map(int, input().split(" "))
flag = False
for i in range(1, b):
    if a * i % b == c:
        flag = True
if flag:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def solve():
    a, b, c = map(int, input().split())
    for i in range(1, b + 1):
        if (a * i) % b == c:
            return "Yes"
    return "No"


if __name__ == "__main__":
    print(solve())

Submission status: Wrong Answer

Solution code:
def solve():
    a, b, c = map(int, input().split())
    for i in range(1, b + 1):
        if a * i % b == c:
            return "Yes"
    return "No"


if __name__ == "__main__":
    print(solve())

Submission status: Wrong Answer

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def ans(x, y, z):
    x1 = x % z
    y1 = y % z
    if (x1 == 0) != (y1 == 0):
        return "NO"
    if x1 == 0 and y1 == 0:
        return "YES"
    return ans(x, x1, y1)

# x = a % b
# y = c % b
# print(x, y)
# if (x == 0) == (y == 0):
#     print("YES")
# else:
#     print("NO")
print(ans(a, c, b))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]
if C == 0:
    print("YES")
else:
    if (A % 2) == (C % 2):
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]
if (A % 2) == ((C+B) % 2):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
from sys import stdin
A,B,C = [int(x) for x in stdin.readline().rstrip().split()]
if (A % 2) == (C % 2):
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

from collections import deque
loop = set()
l = deque([(7*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: Wrong Answer

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

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

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

for i in range(B):
  if A * i % B == C:
    print("YES")
    flag = True
    exit()
  else:
    continue
  print("NO")

Submission status: Wrong Answer

Solution code:
A, B, C = list(map(int, input().split()))
#偶数　偶数　奇数
if A % 2 == 0 and B % 2 == 0 and C % 2 != 0:
    print('NO')
elif A % 2 != B % 2 and C % 2 == 0:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B, C = list(map(int, input().split()))
if A % 2 != 0 and B % 2 != 0:
    print('Yes')
elif A % 2 != B % 2 and C % 2 != 0:
    print('Yes')
elif A % 2 == 0 and B % 2 == 0 and C % 2 == 0:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

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

s=a

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

    else:
        s+=a
print("NO")

Submission status: Wrong Answer

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


def solve(inputs):
    [A, B, X] = list(map(lambda x: int(x), inputs[0].split()))
    num = (B // X) - ((A - 1) // X)
    return num


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

Submission status: Wrong Answer

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(A, A*B+1):
        if c % B == C:
            print('YES')
            exit()

    print('NO')


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
divisor_a=[]
divisor_b=[]
for i in range(1,int(a**(1/2))+1):
  if a%i==0:
    divisor_a.append(i)
    if i!=a//i:
      divisor_a.append(a//i)
for i in range(1,int(b**(1/2))+1):
  if b%i==0:
    divisor_b.append(i)
    if i!=b//i:
      divisor_b.append(b//i)
gcd=max(list((set(divisor_a)&set(divisor_b))))
if c%gcd==0:
  print('YES')
else:
  print('No')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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: 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:
def gcd(a, b):
  if b == 0:
    return a
  else:
    return gcd(b, a%b)

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

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

Submission status: Wrong Answer

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(["YES","NO"][gcd(A,B)<=C])

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

print('No')

Submission status: Wrong Answer

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

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

print("NO")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

#gcd(二つの数)
def gcd(GCD1,GCD2):
    x = min(GCD1,GCD2)
    y = max(GCD1,GCD2)
    if y%x == 0:
        return x
    else:
        return gcd(x,y%x)
    
d=gcd(A,B)
if gcd(d,C) == 1:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

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

#gcd(二つの数)
def gcd(GCD1,GCD2):
    x = min(GCD1,GCD2)
    y = max(GCD1,GCD2)
    if y%x == 0:
        return x
    else:
        return gcd(x,y%x)
    
d=gcd(A,B)
if gcd(d,C) == 1:
    print("No")
else:
    print("Yes")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
for i in range(1,100):
    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%2==C%2:
    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:
    if ((A%2)+(B%2))%2==C%2:
        print('YES')
    elif A%2==B%2==C%2==1:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
D=A%B
if ((D%2)+(B%2))%2==C%2:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c = map(int, input().split())
af = (a%2==0)
bf = ((b+c)%2==0)
if af==bf:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
v = input().split(" ")

a = int(v[0])
b = int(v[1])
c = int(v[2])

amari = []

tmp1 = 0
tmp2 = 0

for i in range(1, b + 1, 1):
    
    tmp1 += a
    
    amari.append(tmp1 % b)

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

Submission status: Wrong Answer

Solution code:
v = input().split(" ")

a = int(v[0])
b = int(v[1])
c = int(v[2])

amari = []

tmp1 = 0
tmp2 = 0

for i in range(1, b + 1, 1):
    
    tmp1 += a
    
    amari.append(tmp1 % b)

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

Submission status: Wrong Answer

Solution code:
A,B,C = [int(x) for x in input().split()]
if(A>B):
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
i = 1
ans = "No"
modlist = []
while True:
    if (B * i + C) % A == 0:
        ans = "Yes"
        break
    else:
        modlist.append((B * i + C) % A)
        i += 1
    if len(modlist) != len(set(modlist)):
        break
print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
if A % 2 == 0:
    if C % 2 == 0:
        print("YES")
        exit()
    else:
        print("NO")
        exit()
else:
    if C % 2 != 0:
        print("YES")
        exit()
    else:
        print("NO")
        exit()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

if A == 1:
    print("YES")
    exit()

if B == 1:
    print("YES")
    exit()

if A % 2 == 0 and B % 2 == 0 and C % 2 == 1:
    print("NO")
    exit()
if fractions.gcd(q, C) == 1 and C != 1:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

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

if A == 1:
    print("YES")
    exit()
if A % 2 == 0 and B % 2 == 0 and C % 2 == 1:
    print("NO")
    exit()
if fractions.gcd(q, C) == 1 and C != 1:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    input = sys.stdin.readline
    try:
        a, b, c = map(int, input().split())
        for i in range(a, 101, a):
            if i < b and b - i == c:
                print("YES")
                break
            elif i % b == c:
                print("YES")
                break
        else:
            print("NO")

    finally:
        input = None

import sys; sys.setrecursionlimit(50000)
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
#ABC060B
A, B, C = map(int, input().split())
if A % 2 == (2 * B + C) % 2 or A==1:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
#ABC060B
A, B, C = map(int, input().split())
if A % 2 == (2 * B + C) % 2:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
#ABC060B
A, B, C = map(int, input().split())
if A % 2 == (2 * B + 1) % 2:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

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

for i in range(1000000):
    if (a*i-c)%b==0:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

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

for i in range(100000):
    if (a*i-c)%b==0:
      print("YES")
    else:
      print("NO")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=[0]*100
for i in range(2,min(a,b)):
    if a%i==0 and b%i==0 and c%i!=0:
        d[i]=1
        break
if max(d)==1:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=[0]*100
for i in range(2,min(a,b)):
    if a%i==0 and b%i==0 and c%i==0:
        d[i]=1
        break
if max(d)==1:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if A<B:
    tmp=A
    A=B
    B=tmp
r = A % B
if r == 0:
    print("YNEOS"[int(bool(C%B))::2])
else:
    if C!=0:    
        if (A-B) % C == 0:
            print("YES")
        else:
            while r != 0:
                A = B
                B = r
                r = A % B
            if B == 1:
                print("YES")
            else:
                print("NO")
    else:
        print("YES")

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
r = A % B
if r == 0:
    print("YNEOS"[int(bool(C%B))::2])
else:
    if C!=0:    
        if (A-B) % C == 0:
            print("YES")
        else:
            while r != 0:
                A = B
                B = r
                r = A % B
            if B == 1:
                print("YES")
            else:
                print("NO")
    else:
        print("YES")

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
r = A % B
if r == 0:
    print("YNEOS"[int(bool(C%B))::2])
else:
    if (A-B) % C == 0:
        print("YES")
    else:
        while r != 0:
            A = B
            B = r
            r = A % B
        if B == 1:
            print("YES")
        else:
            print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
A, B, C = list(map(int, input().split()))
if A == 1:
    print("YES")
elif A % B == C:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
list=[]
i=1
while len(list)==len(set(list)):
    d=a*i
    list.append(d%b)
    i+=1
if c in list:
    print("Yes")
else:
    print("NO")

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

A,B,C = read_int()

first = A % B

for i in range(1,B+2):
    rem = A*i % B
    print(rem)
    if rem == C:
        print('YES')
        break
    elif i != 1 and rem == first:
        print('NO')
        break

Submission status: Wrong Answer

Solution code:
import sys
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

A,B,C = read_int()

first = A % B

for i in range(1,B+2):
    rem = A*i % B
    if rem == C:
        print('YES')
        break
    elif i != 1 and rem == first:
        print('No')
        break

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

Solution code:
a,b,c=[int(i) for i in input().split()]
if c%2==0:
    if a%2==0 and b%2==0:
        print("YES")
    else:
        print("NO")
else:
    if a%2==1 or b%2==1:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
x,y = max(A,B),min(A,B)
while 1:
    if x - y == C:
        print('YES')
        break
    elif x - y <= 0:
        print('NO')
        break
    x,y = max(x-y,y),min(x-y,y)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
x,y = max(A,B),min(A,B)
while 1:
    if x - y <= 0:
        print('NO')
        break
    elif x - y == C:
        print('YES')
        break
    x,y = max(x-y,y),min(x-y,y)

Submission status: Wrong Answer

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

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

if(C == 0):
  print('aaa')
else:
 while(judge):
  if(gcd(A,B) == 1):
   print('YES')
   judge = 0
  else:
   if(gcd(A,B) == gcd(B,C)):
    g = gcd(A,B)
    A,B,C = int(A/g),int(B/g),int(C/g)
   else:
    print('NO')
    judge = 0

Submission status: Wrong Answer

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

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

if(C == 0):
  print('NO')
else:
 while(judge):
  if(gcd(A,B) == 1):
   print('YES')
   judge = 0
  else:
   if(gcd(A,B) == gcd(B,C)):
    g = gcd(A,B)
    A,B,C = int(A/g),int(B/g),int(C/g)
   else:
    print('NO')
    judge = 0

Submission status: Wrong Answer

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

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

if(C == 0):
  print('YES')
else:
 while(judge):
  if(gcd(A,B) == 1):
   print('YES')
   judge = 0
  else:
   if(gcd(A,B) == gcd(B,C)):
    g = gcd(A,B)
    A,B,C = int(A/g),int(B/g),int(C/g)
   else:
    print('NO')
    judge = 0

Submission status: Wrong Answer

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

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

if(C == 0):
 if(gcd(A,B) != 1):
  print('YES')
  judge = 0
 else:
  print('NO')
  judge = 0
else:
 while(judge):
  if(gcd(A,B) == 1):
   print('YES')
   judge = 0
  else:
   if(gcd(A,B) == gcd(B,C)):
    g = gcd(A,B)
    A,B,C = int(A/g),int(B/g),int(C/g)
   else:
    print('NO')
    judge = 0

Submission status: Wrong Answer

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

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

while(judge):
 if(gcd(A,B) == 1):
  print('YES')
  judge = 0
 else:
  if(gcd(A,B) == gcd(B,C)):
    g = gcd(A,B)
    A,B,C = int(A/g),int(B/g),int(C/g)
  else:
    print('NO')
    judge = 0

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
i = 1
hoge = - 10**9
while True:
  hoge2 = hoge
  hoge = (A * i - C) % B
  if hoge == 0:
    print('YES')
    exit()
  i += 1
  if hoge <= hoge2:
    print('NO')
    exit()

Submission status: Wrong Answer

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


main()

Submission status: Wrong Answer

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

a, b, c = [int(i) for i in input().split()]
d=gcd(a,b)
if c % d == 0:
  print("Yes")
else:
  print("No")

Submission status: Wrong Answer

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

start = a%b
for i in range(1,10):
    x = a%b * i
    # print(i, x, x%b)
    if x%b == c:
        print('YES')
        break
    if start == x and i != 1:
        print('NO')
        break

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")
        break
else:print("No")