Harryxun/stf_run huggingface dataset:
Q=int(input())
n=10010
is_prime=[1]*(n+1)
is_prime[0]=is_prime[1]=0
for i in range(2,n+1):
	for j in range(i*2,n+1,i):
		if is_prime[j]==False:
			continue
		is_prime[j]=0
a=[0]*(n+1)
for i in range(2,n+1):
	if is_prime[i]%2==0:
		continue
	if is_prime[i] and is_prime[int((i+1)/2)]:
		a[i]=1
s=[0]*(n+1)		
for i in range(n):
	s[i+1]=a[i]+s[i]
for i in range(Q):
	l,r=map(int,input().split())
	print(s[r+1]-s[l])

### FIXED CODE ###

Q=int(input())
n=100000
is_prime=[1]*(n+10)
is_prime[0]=0
is_prime[1]=0
for i in range(2,n+1):
	for j in range(i*2,n+1,i):
		if is_prime[j]==False:
			continue
		is_prime[j]=0
a=[0]*(n+10)
for j in range(2,n+1):
	if is_prime[j]%2==0:
		continue
	if is_prime[j] and is_prime[int((j+1)/2)]:
		a[j]=1
s=[0]*(n+10)		
for k in range(n):
	s[k+1]=a[k]+s[k]
ans=[]
for _ in range(Q):
	l,r=map(int,input().split())
	ans.append(s[r+1]-s[l])
print(*ans,sep='\n')
n, m = [int(item) for item in input().split()]
a, b = [], []
for i in range(n):
  a.append(input())
for j in range(m):
  b.append(input())

match_line = 0
for i in range(n):
  for j in range(n-m):
    for k in range(m):
      if a[i+k][j:j+m] == b[k]:
        match_line += 1
        if match_line >= m:
          print("Yes")
          exit()
      else:
        match_line = 0
        continue
print("No")

### FIXED CODE ###

n, m = [int(item) for item in input().split()]
a, b = [], []
for i in range(n):
    a.append(input().rstrip())
for i in range(m):
    b.append(input().rstrip())

for i in range(n-m+1):
    for j in range(n-m+1):
        ans = True
        for k in range(m):
            for l in range(m):
                if not a[i+k][j+l] == b[k][l]:
                    ans = False
                    break
        if ans:
            print("Yes")
            exit()
print("No")
in = [input() for i in range(2)]
num = str(in[0])
strCodePoint = ord(in[1])
sum = num + strCodePoint
if sum > 65 + 26 :
  print(char(sum - 26))
else:
  print(char(sum))


### FIXED CODE ###

def changeStr(num, charactor):
  sum = num + ord(charactor)
  if sum > 64 + 26 :
    return chr(sum - 26)
  else:
    return chr(sum)

inputStr = [input() for i in range(2)]
num = int(inputStr[0])
targetStr = inputStr[1]

for target in list(targetStr):
  print(changeStr(num, target), end="")
def makelist2(n, m):
    return [[0 for k in range(m)] for i in range(n)]


N = int(input())
A = []
append = A.append
for i in range(1,N+1):
    a = int(input())
    if a >=i:
        print(-1)
        exit()
    elif A[i-1] > a:
        print(-1)
        exit()
    append(a)

### FIXED CODE ###

n = int(input())
a = [int(input()) for _ in range(n)]
ans = 0
for i in range(n-1,-1,-1):
    if i == 0:
        if a[i] != 0:
            print(-1)
            exit()
    else:
        if a[i-1] + 1 < a[i]:
            print(-1)
            exit()
        elif a[i-1] + 1 == a[i]:
            ans += 1
        else:
            ans += a[i]
print(ans)
N = int(input())
n = int(N/1.08)
if (N // 1.08) == ((N+1) //1.08) or int(n * 1.08) < N and N < int((n+1) * 1.08):
    print(':(')
else:
    print((N//1.08))

### FIXED CODE ###

M1, D1 = map(int,input().split())
M2, D2 = map(int,input().split())
if M1 in [1,3,5,7,8,10] and M1+1 == M2 and D1 ==31 and D2 == 1:
    ans =1
elif M1 ==2 and M2 ==3 and D1==28 and D2 ==1:
    ans = 1
elif M1 == 12 and M2 == 1 and D1 == 31 and D2 ==1:
    ans =1
elif M1 in [4,6,9,11] and M1 +1 == M2 and D1==30 and D2 == 1:
    ans =1
else:
    ans=0
print(ans)
n=map(int,input().split())
a=list(map(int,input().split()))
x=0
for i in a:
  if i%2==0:
   	x+=1
print(3**n-2**x)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
x=0
for i in a:
  if i%2==0:
   	x+=1
print(3**n-2**x)
x = input()
print(pow(x, 3)\n)

### FIXED CODE ###

x = input()
print(x ** 3)
x=int(input())
y=sorted(x)
if (y[0]+y[1])%2==0:
  print((2*y[2]-y[1]-y[0])/2)
else :
  print((2*y[2]-y[1]-y[0]+3)/2)

### FIXED CODE ###

x=list(map(int,input().split()))
y=sorted(x)
if (y[0]+y[1])%2==0:
  print(int((2*y[2]-y[1]-y[0])/2))
else :
  print(int((2*y[2]-y[1]-y[0]+3)/2))
N,X=map(int, input().split())
M=list(map(int, input().split()))
X = X - sum(M)
cnt += N
cnt += X // min(M)
print(cnt)

### FIXED CODE ###

#!/usr/bin/env python3
from itertools import product, permutations, combinations
from bisect import bisect_right,bisect_left
INF = float('inf')

N,X=map(int, input().split())
M=[int(input()) for i in range(N)]
Y = X - sum(M)

cnt = N
cnt += (Y // min(M))
print(cnt)
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()

    H,W = LI()
    ch, cw = _LI()
    dh, dw = _LI()
    m = [[0] * W for _ in range(W)]
    for i in range(H):
        s = SI()
        for j in range(W):
            if s[j] == "#":
                m[i][j] = -1

    z = [(ch,cw,1)]
    while z:
        x,y,c = z.pop()
        if m[x][y]: continue
        q = collections.deque()
        q.append((x,y))
        m[x][y] = c
        r = [(x,y)]
        while q:
            x,y = q.popleft()
            if x == dh and y == dw:
                print(c-1)
                return
            for dx,dy in ((0,1),(1,0),(-1,0),(0,-1)):
                nx = x + dx
                ny = y + dy
                if not(0<= nx < H and 0<= ny < W): continue
                if m[nx][ny]: continue
                m[nx][ny] = c
                q.append((nx,ny))
                r.append((nx,ny))
        for x,y in r:
            for dx in range(-2,3):
                nx = x + dx
                if not(0<= nx < H): continue
                for dy in range(-2,3):
                    ny = y + dy
                    if not(0<= ny < W): continue
                    if m[nx][ny]: continue
                    z.append((nx,ny,c+1))
    print(-1)
if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()

    H,W = LI()
    ch, cw = _LI()
    dh, dw = _LI()
    m = [[0] * W for _ in range(H)]
    for i in range(H):
        s = SI()
        for j in range(W):
            if s[j] == "#":
                m[i][j] = -1

    z = collections.deque()
    z.append((ch,cw,1))
    while z:
        x,y,c = z.popleft()
        if m[x][y]: continue
        q = collections.deque()
        q.append((x,y))
        m[x][y] = c
        r = [(x,y)]
        while q:
            x,y = q.popleft()
            if x == dh and y == dw:
                print(c-1)
                return
            for dx,dy in ((0,1),(1,0),(-1,0),(0,-1)):
                nx = x + dx
                ny = y + dy
                if not(0<= nx < H and 0<= ny < W): continue
                if m[nx][ny]: continue
                m[nx][ny] = c
                q.append((nx,ny))
                r.append((nx,ny))
        for x,y in r:
            for dx in range(-2,3):
                nx = x + dx
                if not(0<= nx < H): continue
                for dy in range(-2,3):
                    ny = y + dy
                    if not(0<= ny < W): continue
                    if m[nx][ny]: continue
                    z.append((nx,ny,c+1))
    print(-1)
if __name__ == '__main__':
    main()
n = int(input())
vl = [int(i) for i in input().split()]
oc = Counter(a for i, a in enumerate(vl) if i % 2 == 0)
ec = Counter(a for i, a in enumerate(vl) if i % 2 == 1)
ol = sorted(((v, k) for k, v in oc.items()), reverse=True)
el = sorted(((v, k) for k, v in ec.items()), reverse=True)

if ol[0][1] != el[0][1]:
    print(n - ol[0][0] - el[0][0])
else:
    if ol[0][0] >= el[0][0]:
        if len(el) >= 2:
            print(n - ol[0][0] - el[1][0])
        else:
            print(n - ol[0][0])
    else:
        if len(ol) >= 2:
            print(n - ol[1][0] - el[0][0])
        else:
            print(n - el[0][0])

### FIXED CODE ###

from collections import Counter
n = int(input())
vl = [int(i) for i in input().split()]
oc = Counter(a for i, a in enumerate(vl) if i % 2 == 0)
ec = Counter(a for i, a in enumerate(vl) if i % 2 == 1)
ol = sorted(((v, k) for k, v in oc.items()), reverse=True)
el = sorted(((v, k) for k, v in ec.items()), reverse=True)

if ol[0][1] != el[0][1]:
    print(n - ol[0][0] - el[0][0])
else:
    res = 1 << 30
    if len(ol) == len(el) == 1:
        res = n // 2
    if len(ol) > 1:
        res = min(res, n - ol[1][0] - el[0][0])
    if len(el) > 1:
        res = min(res, n - ol[0][0] - el[1][0])
    print(res)
import statistics

N = int(input())
a = list(map(int, input().split()))

b = []
c = []
for i in range(N):
    b.append(a[i] - 1)
    c.append(a[i] + 1)

x = a + b + c
y = statistics.mode(x)

print(x.count(y))


### FIXED CODE ###

N = int(input())
a = list(map(int, input().split()))

b = []
c = []
for i in range(N):
    if a[i] > 0:
        b.append(a[i] - 1)
        c.append(a[i] + 1)
    else:
        c.append(a[i] + 1)

abc = a + b + c
count = [0] * (max(abc) + 1)

for x in abc:
    count[x] += 1

print(max(count))
from sys import stdin
from math import factorial

if __name__ == '__main__':
    N, K = [int(x) for x in stdin.readline().rstrip().split()]
    a = [int(x) for x in stdin.readline().rstrip().split()]

    # 総組み合わせ数(nCr + N)の計算 n=N, r=2
    # N は数字を一つだけ選ぶパターン
    max = (factorial(N) // factorial(2) // factorial(N - 2)) + N

    # 条件を満たさないパターンを総当たりで計算
    count = 0
    for i in range(N):
        for j in range(N):
            if i > j:
                continue

            tmp = sum(a[i:j+1])

            if tmp < K:
                count = count + 1
            else:
                break

    print(max - count)


### FIXED CODE ###

from sys import stdin

X, A = [int(x) for x in stdin.readline().rstrip().split()]

if X < A:
    print(0)
else:
    print(10)
n=int(input());s=input();print(max(len(set(s[:i])&set(s[i:]))for i in range(n)))


### FIXED CODE ###

a, b = map(int, input().split())
calcs = [a + b, a - b, a * b]
print(max(calcs))
from sys import stdin


class C:
	def __init__(self,A,B,C,D):
		self.A = int(A)
		self.B = int(B)
		self.C = int(C)
		self.D = int(D)
		self.list = list(range(self.A,self.B+1)) #リストの生成
		self.ans_list = list()
	def main(self):
		for i in range(self.A,self.B+1):
			if i % self.C != 0:
				if  i % self.D != 0:
					self.ans_list.append(i)

		print(len(self.ans_list))








Inp = stdin.readline()
Inp = Inp.replace('\n','')
Inp = Inp.split()

do = C(Inp[0],Inp[1],Inp[2],Inp[3])

do.main()


### FIXED CODE ###

import fractions

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


c_and_d=C*D
#CとDの最小公倍数を求める
lcm = int(C*D//fractions.gcd(C,D))


count_C =0
count_D =0
count_C_and_D =0

count_C = int(B//C)-int((A-1)//C)
count_D = int(B//D)-int((A-1)//D)
count_C_and_D = int(B//lcm)-int((A-1)//lcm)

print(int((B-A+1) -(count_C + count_D - count_C_and_D)))
from collections import Counter, defaultdict, deque
import bisect
from sys import stdin, stdout
from itertools import repeat
import math
 
# sys.stdin = open('input')
 
def inp(force_list=False):
    re = map(int, raw_input().split())
    if len(re) == 1 and not force_list:
        return re[0]
    return re
 
def inst():
    return raw_input().strip()
 
def gcd(x, y):
   while(y):
       x, y = y, x % y
   return x
 
mod = 1000000007
def idx(c):
    return ord(c) - ord('a')

class Fenwick(object):
    def __init__(self, n):
        self.n = n
        self.da = [0] * n
    
    def add(self, pos, x):
        while pos < self.n:
            self.da[pos] += x
            pos |= pos + 1

    def ps(self, pos):
        re = 0
        while pos >= 0:
            re += self.da[pos]
            pos &= pos + 1
            pos -= 1
        return re

    def sum(self, x, y):
        return self.ps(y) - self.ps(x-1)

def my_main():
    n, nq = inp()
    da = inp()
    q = []
    for i in range(nq):
        l, r = inp()
        q.append((l, r, i))
    q.sort(key=lambda e:e[-2])
    mp = [-1] * (510000)
    now = -1
    fw = Fenwick(n)
    ans = [0] * nq
    for l, r, idx in q:
        l -= 1
        r -= 1
        while now < r:
            now += 1
            if mp[da[now]]!=-1:
                fw.add(mp[da[now]], -1)
            mp[da[now]] = now
            fw.add(now, 1)
        ans[idx] = fw.sum(l, r)

    print '\n'.join(map(str, ans))



my_main()

### FIXED CODE ###

from collections import Counter, defaultdict, deque
import bisect
from sys import stdin, stdout
from itertools import repeat
import math
 
# sys.stdin = open('input')
 
def inp(force_list=False):
    re = map(int, raw_input().split())
    if len(re) == 1 and not force_list:
        return re[0]
    return re
 
def inst():
    return raw_input().strip()
 
def gcd(x, y):
   while(y):
       x, y = y, x % y
   return x
 
mod = 1000000007
def idx(c):
    return ord(c) - ord('a')

class Fenwick(object):
    def __init__(self, n):
        self.n = n
        self.da = [0] * n
    
    def add(self, pos, x):
        while pos < self.n:
            self.da[pos] += x
            pos |= pos + 1

    def ps(self, pos):
        re = 0
        while pos >= 0:
            re += self.da[pos]
            pos &= pos + 1
            pos -= 1
        return re

    def sum(self, x, y):
        return self.ps(y) - self.ps(x-1)

def my_main():
    n, nq = inp()
    da = inp()
    q = []
    for i in range(nq):
        l, r = inp()
        q.append((l, r, i))
    q.sort(key=lambda e:e[-2])
    mp = [-1] * (n+5)
    now = -1
    fw = Fenwick(n)
    ans = [0] * nq
    for l, r, idx in q:
        l -= 1
        r -= 1
        while now < r:
            now += 1
            try:
                if mp[da[now]]!=-1:
                    fw.add(mp[da[now]], -1)
                mp[da[now]] = now
            except:
                pass
            fw.add(now, 1)
        ans[idx] = fw.sum(l, r)

    print '\n'.join(map(str, ans))


            

 
 
 
 
my_main()
import numpy as np
if __name__ == "__main__":
    T = input().rstrip().split(' ')
    T = int(T[0])
    for t in range(T):
        line = input().rstrip().split(' ')
        A = int(line[0])
        B = int(line[1])
        C = int(line[2])
        D = int(line[3])
        A_list = []
        flag = True

        if B > A:
            print('No')
            continue
        if B > D:
            print('No')
            continue
        if C > B:
            print('Yes')
            continue

        while True:
            if A in A_list:
                flag = True
                break
            A_list.extend([A])
            if A < B:
                flag = False
                break
            q, A = divmod(A, B)
            for i in range(q-1):
                if A + B > C:
                    break
                A += B
            A_list.extend([A + B])
            if A <= C:
                A += D
        if flag:
            print('Yes')
        else:
            print('No')


### FIXED CODE ###

if __name__ == "__main__":
    N = input().rstrip().split(' ')
    N = int(N[0])
    line = input().rstrip().split(' ')
    count = 0
    skip_flag = False
    for i in range(len(line)-1):
        if skip_flag:
            skip_flag = False
            continue
        if line[i] == line[i+1]:
            count += 1
            skip_flag = True
    print(count)
x=int(input())
temp=0
for i in range(1,x):
  temp=temp+i
  if temp>=x:
    break
print(i)

### FIXED CODE ###

x=int(input())
temp=0
for i in range(1,x+1):
  temp=temp+i
  if temp>=x:
    break
print(i)
n,m,c=map(int,input().split())
b=list(map(int,input().split()))
cnt =0
for i in range(n):
  a=list(map(int,input().split()))
  s=C+sum([b[j]*a[j] for j in range(m)])
  if s>0:
    cnt +=1
print(cnt)

### FIXED CODE ###

n,m,c=map(int,input().split())
b=list(map(int,input().split()))
cnt =0
for i in range(n):
  a=list(map(int,input().split()))
  s=c+sum([b[j]*a[j] for j in range(m)])
  if s>0:
    cnt +=1
print(cnt)
MOD = 10**9 + 7
n = int(input())
dp = [0 for _ in range(n+1)]
dp[0], dp[1], dp[2] = 1, 1, 1
cum = [0 for _ in range(n+1)]
cum[0], cum[1], cum[2] = 1, 2, 3
for i in range(3, n+1):
	dp[i] = (dp[i-1] + cum[i-3]) % MOD
	cum[i] = (cum[i-1] + dp[i]) % MOD
ans = cum[n-2] * (n-1) * (n-1) + dp[n-1] * (n-1) + cum[n-2] * (n-1) + 1
print(ans%MOD)

### FIXED CODE ###

MOD = 10**9 + 7
n = int(input())
if n == 1:
	print(1)
else:
	dp = [0 for _ in range(n+1)]
	dp[0], dp[1], dp[2] = 1, 1, 1
	cum = [0 for _ in range(n+1)]
	cum[0], cum[1], cum[2] = 1, 2, 3
	for i in range(3, n+1):
		dp[i] = (dp[i-1] + cum[i-3]) % MOD
		cum[i] = (cum[i-1] + dp[i]) % MOD
	ans = cum[n-2] * (n-1) * (n-1) + dp[n-1] * (n-1) + cum[n-2] * (n-1) + 1
	print(ans%MOD)
a=int(input("a"))
b=int(input("b"))

if (a*b)%2 ==1:
	print('Odd')
else:
	print('Even')

### FIXED CODE ###

a,b=map(int,input().split())
if (a*b)%2 ==0:
  print('Even')
else:
  print('Odd')
from bisect import bisect_left as bl
from collections import deque as dq
X, Y, Z, K = map(int, input().split())
ABC = [sorted(list(map(int, input().split()))) for _ in range(3)]
temp = []
minabc = bl((X, Y, Z), min(X, Y, Z))
abcs = [i for i in range(3) if i != minabc]
for i in range((X, Y, Z)[abcs[0]]):
  for j in range((X, Y, Z)[abcs[1]]):
    temp.append(ABC[abcs[0]][i] + ABC[abcs[1]][j])
temp.sort()
r = len(temp) - 1
u = 0
Q = dq([])
Q.append([r, u])
res = []
visited = [[0] * len(temp) for _ in range((X, Y, Z)[minabc])]
while len(Q):
  q = Q.popleft()
  res.append(temp[q[0]] + ABC[minabc][q[1]])
  if r - q[0] + q[1] > K:
    continue
  if q[0] != 0 and visited[q[1]][q[0] - 1] == 0:
    Q.append([q[0] - 1, q[1]])
    visited[q[1]][q[0] - 1] = 1
  if q[1] != (X, Y, Z)[minabc] - 1 and visited[q[1] + 1][q[0] - 1] == 0:
    Q.append([q[0], q[1] + 1])
    visited[q[1] + 1][q[0]] = 1
res.sort()
for _ in range(K):
  print(res.pop())

### FIXED CODE ###

from bisect import bisect_left as bl
from collections import deque as dq
X, Y, Z, K = map(int, input().split())
ABC = [sorted(list(map(int, input().split()))) for _ in range(3)]
AB = []
for i in range(X):
  for j in range(Y):
    AB.append(ABC[0][i] + ABC[1][j])
AB.sort(reverse = True)
res = []
for i in range(min(K, X * Y)):
  for j in range(Z):
    res.append(AB[i] + ABC[2][j])
res.sort(reverse = True)
for i in range(K):
  print(res[i])
import itertools
num = int(input())
cmlist = input().split(' ')
count = 0
for i,j,k in itertools.combinations(cmlist, 3):
  if int(i)<int(j)+int(k) and int(j)<int(i)+int(k) and int(k)<int(i)+int(j):
    count+=1
print(count)

### FIXED CODE ###

data = input()
print(max(int(data.split(' ')[0])-int(data.split(' ')[1])*2,0))
count = 0
a = b = c = ''


line = input()

while line[i] != ' ':
    a = a + line[i]
    i += 1

i += 1
while line[i] != ' ':
    b = b + line[i]
    i += 1

i += 1    
while i < len(line):
    c = c + line[i]
    i += 1
    
a = int(a)
b = int(b)
c = int(c)

while a <= b:
    if c%a == 0:
        count += 1
    a += 1

print(count)

### FIXED CODE ###

i = count = 0
a = b = c = ''


line = input()

while line[i] != ' ':
    a = a + line[i]
    i += 1

i += 1
while line[i] != ' ':
    b = b + line[i]
    i += 1

i += 1    
while i < len(line):
    c = c + line[i]
    i += 1
    
a = int(a)
b = int(b)
c = int(c)

while a <= b:
    if c%a == 0:
        count += 1
    a += 1

print(count)
from itertools import groupby

N, K = map(int, input().split())
sushi = sorted([tuple(map(int, input().split())) for _ in range(N)],
               key=lambda s: s[1])

maximums = []
remains = []
v = set()
for k, g in groupby(sushi[-K:], key=lambda x: x[0]):
    v.add(k)
    ds = list(list(zip(*g))[1])
    maximums.append(ds.pop())
    remains.extend(ds)
remains = sorted(remains)
ans = sum(maximums) + sum(remains) + len(v)**2

max_v = max(K, len(set(list(zip(*sushi))[0])))

for k, g in groupby(sorted(sushi[:-K], key=lambda x: x[0]), key=lambda x: x[0]):
    if k in v:
        continue
    v.add(k)
    ds = list(list(zip(*g))[1])
    maximums.append(ds.pop())
    remains.pop()
    ans = max(ans, sum(maximums) + sum(remains) + len(v)**2)

print(ans)

### FIXED CODE ###

N, K = map(int, input().split())
sushi = [list(map(int, input().split())) for _ in range(N)]
sushi.sort(key=lambda x: x[1], reverse=True)

score = 0

remains = []
kinds = set()
for t, d in sushi[:K]:
    if t in kinds:
        remains.append(d)
    kinds.add(t)
    score += d
score += len(kinds)**2

test = score
for t, d in sushi[K:]:
    if not remains:
        break
    if t in kinds:
        continue
    kinds.add(t)
    rm = remains.pop()
    test = test + (d - rm) + (len(kinds)*2 - 1)
    score = max(score, test)

print(score)
h, w = list(map(int, input().split()))
grid = []
for i in range(h):
    temp = list(input())
    if "#" in temp:
        grid.append(temp)
    else:
        h -= 1
i = 0
while i < len(grid[0]):
    for j in range(h):
        if grid[j][i] == "#":
            i += 1
            break
        if j == h - 1:
            for k in range(h):
                del grid[k][i]
for i in range(len(grid[0])):
    print("".join(grid[i]))

### FIXED CODE ###

h, w = list(map(int, input().split()))
grid = []
for i in range(h):
    temp = list(input())
    if "#" in temp:
        grid.append(temp)
    else:
        h -= 1
i = 0
while i < len(grid[0]):
    for j in range(h):
        if grid[j][i] == "#":
            i += 1
            break
        if j == h - 1:
            for k in range(h):
                del grid[k][i]
for i in range(h):
    print("".join(grid[i]))
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()

### FIXED CODE ###

a, b, c = map(int, input().split())
num = a
for i in range(b):
    if num % b == c:
        print('YES')
        break
    num += a
else:
    print('NO')
import math
n = int(input())
a = map(int, input().split())

def cnt(arr):
    g = c = 0
    for i in arr: g = math.gcd(g,i)
    while g%2==0:
        g/=2
        c += 1
    return c

print(cnt(a))

### FIXED CODE ###

n = int(input())
a = map(int, input().split())

def cnt(li, c):
    arr = []
    for i in li:
        arr.append(i/2)
        if i%2!=0: return c
    return cnt(arr, c+1)

print(cnt(a,0))