Problem:


Score : 200 points

Problem Statement

We ask you to select some number of positive integers, and calculate the sum of them.

It is allowed to select as many integers as you like, and as large integers as you wish.
You have to follow these, however: each selected integer needs to be a multiple of A, and you need to select at least one integer.

Your objective is to make the sum congruent to C modulo B.
Determine whether this is possible.

If the objective is achievable, print YES. Otherwise, print NO.

Constraints

1 ≤ A ≤ 100

1 ≤ B ≤ 100

0 ≤ C < B

Input

Input is given from Standard Input in the following format:

A B C

Output

Print YES or NO.

Sample Input 1

7 5 1

Sample Output 1

YES

For example, if you select 7 and 14, the sum 21 is congruent to 1 modulo 5.

Sample Input 2

2 2 1

Sample Output 2

NO

The sum of even numbers, no matter how many, is never odd.

Sample Input 3

1 100 97

Sample Output 3

YES

You can select 97, since you may select multiples of 1, that is, all integers.

Sample Input 4

40 98 58

Sample Output 4

YES

Sample Input 5

77 42 36

Sample Output 5

NO



Sample input:
7 5 1


Sample output:
YES

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

m = []
m.append(a % b)
n = 2
while(a * n % b not in m):
    m.append(a * n % b)
    n += 1

if c not in m:
    print("NO")
else:
    print("YES")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

n = 0
while n < 10**6:
    if (n*a - c) % b == 0:
        print "YES"
        break
    n += 1
else:
    print "NO"

Submission status: Accepted

Solution code:
A = list(map(int,input().split(" ")))
B = 0
for i in range(100):
    if (A[0]*(i + 1)) % A[1] == A[2]:
        B = 1
        break
if B == 1:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

Submission status: Runtime Error

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

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

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

print(ans)

Submission status: Runtime Error

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

ans="No"
for i in range(1,b+1):
  for j in range(1,a+1):
    if a*i=b*j+c:
      ans="Yes"
      break
      
print(ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if c>a:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

inline void solve(){
    map <int,bool> cnt;
    int a,b,c; cin>>a>>b>>c; 
    int i=a;
    while (true){
        if (i%b==c) break;
        if (cnt[i%b] and i%b != c) cout << "No"<< endl,exit(0);
        cnt[i%b]=true;
        i += a;
    }

    cout << "Yes" << endl;
}

signed main()
{
    int n=1; // cin>>n;
    while (n--) solve();
    return 0;
}

Submission status: Runtime Error

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

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

if Flag == True:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from math import gcd
def check():
    A, B, C = map(int, input().split())
    if C%gcd(A,B)==0:
        return 'YES'
    return 'NO'
print(check())

Submission status: Runtime Error

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

Submission status: Runtime Error

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

x = a % b
y = c % b

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

Submission status: Runtime Error

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

x = b % b
y = c % b

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

Submission status: Runtime Error

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

x = A % B
y = C % B

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

Submission status: Runtime Error

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

d=a%b
if c%d==0:
  frag="YES"
else:
  frag="NO"
print(frag)

Submission status: Runtime Error

Solution code:
from math import gcd
a,b,c = map(int, input().split())
if gcd(a,b)%c==0:
  print('Yes')
  exit()
print('No')

Submission status: Runtime Error

Solution code:
from otsutil import parg
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: Runtime Error

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

Submission status: Runtime Error

Solution code:

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: Runtime Error

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

flag = False

for i in range(B + 1):
    if A * i %B == c:
        flag = True
        break

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

a, b, c = map(int, input().split())
res = False
n = abs(b * c // (b - a))
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: Runtime Error

Solution code:
a, b, c = map(int, input().split())
res = False
n = abs(b * c // (b - a))
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: Runtime Error

Solution code:
for i in range(1, 100):
    if a*i % b == c:
        print('YES')
        break
else:
    print('NO')

Submission status: Runtime Error

Solution code:
A, B, C = map(int, input().split())
if A % B == 0:
    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 C % (B - A) == 0 or (B - C) % A == 0 or (B - C) % (B % A):
        print('YES')
    else:
        print('NO')

Submission status: Runtime Error

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 C % (B - A) == 0 or (B - C) % A == 0 or (B - C) % (B % A):
        print('YES')
    else:
        print('NO')

Submission status: Runtime Error

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 C % (A % B) == 0 or (B - C) % (B % A) == 0:
        print('YES')
    else:
        print('NO')

Submission status: Runtime Error

Solution code:
import math

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

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

Submission status: Runtime Error

Solution code:
import math

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

if C%math.gcd(A, B)==0:
    print("Yes")
else:
    print("No")

Submission status: Runtime Error

Solution code:
import math

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

if C%math.gcd(A, B)==0:
    print("Yes")
    break
else:
    print("No")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

D = A % B
M = D
ok = False
for _ in range(B+1):
  if M == C:
    ok = True
	break
    
  M = (M + D) % B
  
if ok:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
from math import gcd

A, B, C = map(int, open(0).read().split())

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

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

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

Submission status: Runtime Error

Solution code:
from math import gcd

def ngcd(nums):
	n = 0
	for i in nums:
		n = gcd(n, i)
	return n

def resolve():
	nums = list(map(int, input().split()))
	t = ngcd(nums)
	if t != 1:
		nums = [int(i/t) for i in nums]
	if gcd(nums[0], nums[1]) == 1:
		print("YES")
	else:
		print("NO")
resolve()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
from fructions import gcd

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

if c%gcd(a, b):
  print("NO")
else:
  print("YES")

Submission status: Runtime Error

Solution code:
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
from math import pi, gcd, 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: Runtime Error

Solution code:
from heapq import heappush, heappop
from itertools import permutations, accumulate, combinations
from math import pi, gcd, 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
    r = []
    while True:
        if num % b == c:
            print("YES")
            exit()
        if num % b in r:
            break
        r.append(num % b)
        num += a
    print('NO')

if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import math

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

if c%g == 0:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

Solution code:
import math

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

if c%g == 0:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

import math

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

d=math.gcd(a,b)

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

Submission status: Runtime Error

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

import math

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

d=math.gcd(a,b)

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input().split())
import math
ans = 'Yes' if c % math.gcd(a,b) == 0 else 'No'
print(ans)

Submission status: Runtime Error

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

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

print('NO')

Submission status: Runtime Error

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

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

print('NO')

Submission status: Runtime Error

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

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

print('NO')

Submission status: Runtime Error

Solution code:
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
import sys,bisect,string,math,time,functools,random
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[];g=[[] for i in range(n)]
    for i in range(E):
        inp=LI();org_inp.append(inp)
        if index==0:inp[0]-=1;inp[1]-=1
        if len(inp)==2:
            a,b=inp;g[a].append(b)
            if not Directed:g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp;aa=(inp[0],inp[2]);bb=(inp[1],inp[2]);g[a].append(bb)
            if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,boundary=1,search=[],replacement_of_found='.',mp_def={'#':1,'.':0}):
#h,w,g,sg=GGI(h,w,boundary=1,search=['S','G'],replacement_of_found='.',mp_def={'#':1,'.':0}) # sample usage
    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):return [[tb//(n**bt)%n for bt in range(k)] for tb in range(n**k)]
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)
def show2d(g,h,w):
    for i in range(h):show(g[i*w:i*w+w])

YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
#sys.setrecursionlimit(10**7)
input=lambda: sys.stdin.readline().rstrip()

show_flg=False
show_flg=True

a,b,c=LI()
d=math.gcd(a,b)
print(YN[c%d!=0])

Submission status: Runtime Error

Solution code:
a,b,c = map(int,input().split())
s = sum(list(map(int,input().split())))
if s % b ==c:
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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


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

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

Submission status: Runtime Error

Solution code:
A, B, C = map(int, input().split())
li=[]
for i in range(1000000):
  c=A*(i+1)%B
  if c  in li:
    break
  li += c

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

Submission status: Runtime Error

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
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 STR(): return input()
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 = sys.maxsize
mod = 10 ** 9 + 7

a, b, c = MAP()
d = a % b
if c % d == 0:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

flg = 0

for i in range(100000000):
    if (i*a)%b = c:
        flg+=1
    break

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

Submission status: Runtime Error

Solution code:
w,h,n=map(int,input().split())
mat=[[1]*h for _ in range(w)]
print(mat)
l=[-1]*5
l[2]=float('inf')
l[4]=float('inf')
for _ in range(n):
    x,y,a=map(int,input().split())
    if a==1:
        l[1]=max(l[1],x)
    elif a==2:
        l[2]=min(l[2],x)
    elif a==3:
        l[3]=max(l[3],y)
    else:
        l[4]=min(l[4],y)
for i in range(h):
    for j in range(w):
        if l[1]!=-1:
            if i<

Submission status: Runtime Error

Solution code:
n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

k = 1
p = False
for i in range(n):
    if a[k-1] == 2:
        print(i+1)
        p = True
        break
    k = a[k-1]
if not p:
    print(-1)

Submission status: Runtime Error

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

Submission status: Runtime Error

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 = math.gcd(A, B)
print(Gcd)

print(C)

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

Submission status: Runtime Error

Solution code:
## coding: UTF-8
import math
s = input().split()
t = [int(p) for p in s]
#print(t)

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

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

Submission status: Runtime Error

Solution code:
import math
A,B,C=map(int,input().split())
lcm = A*B//math.gcd(A,B)
#A*(i+j)%B=C
#A*(i+j)=BX+C
i=A
while i<=lcm:
  if i%B==C:
    print("YES")
    exit()
  i*=A
print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# coding: utf-8
a,b,c=map(int,input().split())
if b%2==0:
    if a%2==0:
        if c%2==0:
            print('YES')
        else:
            print('NO')
    else:
        if c%2==0:
            print('NO')
        else:
            print('YES')
else:
    pirnt('YES')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:


def main():
    N, K = map(int, input().split())
    res = K * (K -1)**(N-1)

    print(res)

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import math

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

if gcd == 1 and C != 0 or gcd != 1 and math.gcd(gcd, C) != 1:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input())
s=set()
while True:
  x=a%b
  if x==c:
    print("YES")
    break
  elif x in s:
    print("NO")
    break
  else:
    s.add(x)

Submission status: Runtime Error

Solution code:
from numpy import*;a,b,c=int_(input().split());print('YNEOS'[c%gcd(a,b)>0::2])

Submission status: Runtime Error

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
import numpy as np

def main():
    a,b,c=MI()
    g=np.gcd(a,b)
    if c%g:print("NO")
    else:print("YES")

main()

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

aj = a%2
bj = b%2
cj = c%2

if aj == bj == cj == 1 or aj == bj == cj ==0 or (aj == bj ==1 and cj ==0 ) or (aj == cj == 1 and bj == 0) or (aj == 0 and bj==cj==1):
  print("YES")
else:
  p

Submission status: Runtime Error

Solution code:


import numpy as np
import math

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

Solution code:
import sys
input = sys.stdin.readline
A,B,C=map(int,input().rstrip().split())
for i in range(B):
    if (i*(A%B))% B == C:
        print("YES")
        return
print("NO")

Submission status: Runtime Error

Solution code:
import math

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

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

Submission status: Runtime Error

Solution code:
import math

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

ret = C % math.gcd(A,B) == 0
print('Yes' if ret else 'No')

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
rest = set()
for i in range(b):
    rest.add(a * i % b)
if c in list(set):
    print("YES")
else:
    print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
start = time.time()
A,B,C = map(int,input().split())
flag = 0
if A == 1:
    flag = 1
else:    
    while flag == 0:
        if A%B == C:
            flag = 1
            break
        else:
            A += A
        now = time.time() - start
        if now > 1.9:
            break
if flag == 0:
    print("NO")
else:
    print("YES")

Submission status: Runtime Error

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

Submission status: Runtime Error

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

if C%(((B//A +1)*A)%B) == 0:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

a = A % B

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

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

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

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

print(ans)

Submission status: Runtime Error

Solution code:
import math
a,b,c = map(int,input().split())
if math.gcd(a,b) == 1:
    print('YES')
else:
    print('NO')

Submission status: Runtime Error

Solution code:
import math
a, b, c = map(int, input().split())
if math.gcd(a,b) == c:
  print("YES")
else:
  print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# ABC060b
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

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

Submission status: Runtime Error

Solution code:
# ABC060b
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

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

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

Submission status: Runtime Error

Solution code:
import math
import sys
a, b, c = map(int, input().split())
lcm = (a * b)//(math.gcd(a,b))
for i in [x*a for x in range(1, lcm+1)]:
    if i % b == c:
        print("YES")
        sys.exit()
print("NO")

Submission status: Runtime Error

Solution code:
import math
import sys
a, b, c = map(int, input().split())
lcm = a*b//math.gcd(a,b)
for i in [x*a for x in range(1, lcm+1)]:
    if i % b == c:
        print("YES")
        sys.exit()
print("NO")

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
lp=[a*i/b-c for i in range(10*10)]
if 0 in ;p:
  print('YES')
else:
  print('NO')

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a, b, c = map(int, input().split())
d = a%b
e = (b+c) % d
print('No' if e else 'Yes')

Submission status: Runtime Error

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

Submission status: Runtime Error

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