peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
from bisect import bisect_right

def divisor(n):
    ass = []
    for i in range(1,int(n**0.5)+1):
        if n%i == 0:
            ass.append(i)
            if i**2 == n:
                continue
            ass.append(n//i)
    ass.sort()
    return ass 

N,M = map(int,input().split())
a = M//N

li = divisor(M)

x = bisect_right(li,a)

print(li[x-1])
# Judge status: Wrong Answer
n = int(input())
k = int(input())
x = int(input())
y = int(input())

fee1 = k * x
fee2 = y * (n - k)

if k > n :
    print(fee1)
else:
    print(fee1 + fee2)
# Judge status: Accepted
if int(input())>999:
    print("ABD")
else:
    print("ABC")
# Judge status: Accepted
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N,M = map(int,input().split())
X = list(map(int,input().split()))

if N >= M:
    print(0)
else:
    X.sort()
    D = []
    for i in range(M-1):
        D.append(X[i+1]-X[i])
    D.sort()
    print(sum(D[0:M-N]))
# Judge status: Wrong Answer
N,A,B,C,D = map(int,input().split())
S = input()
A_start = True
if C < D:
  space1 = S[A:D+1]
  if ('##' in space1) != True:
    print('Yes')
  else:
    print('No')
else:
  space1 = S[A:C+1]
  space2 = S[B-1:D+1]
  if ('##' in space1) != True and ('...' in space2) == True:
    print('Yes')
  else:
    print('No')
# Judge status: Accepted
n = int(input())
a = sorted(list(map(int, input().split())))

m = a[-1]
r = sorted(a[:-1], key = lambda x: abs((m-x)-x))[0]
print(m, r)
# Judge status: Accepted
W,H,N = map(int,input().split())
dl = (0,0)
ur = (W,H)
for i in range(N):
    x,y,a = map(int,input().split())
    if a==1:
        dl = (max(dl[0],x),dl[1])
    elif a==2:
        ur = (min(ur[0],x),ur[1])
    elif a==3:
        dl = (dl[0],max(dl[1],y))
    else:
        ur = (ur[0],min(ur[1],y))
print(max((ur[0]-dl[0]),0)*max((ur[1]-dl[1]),0))
# Judge status: Accepted
n = int(input())
s = input()

count_r = 0
for i in range(n):
  if s[i] == "R":
    count_r += 1

ans = 0
for i in range(count_r):
  if s[i] == "W":
    ans += 1
    
print(ans)
# Judge status: Accepted
from collections import deque

X = input()
N = len(X)
S = "S"
T = "T"
stack = deque("")

for i,str in enumerate(X):
  if str == S:
    stack.append(str)
  elif str == T:
    if len(stack) == 0:
      stack.append(str)
    elif stack[-1] == T:
      stack.append(str)
    elif stack[-1] == S:
      stack.pop()
      
print(len(stack))
# Judge status: Accepted
import math
b,c=map(str,input().split())
d=math.sqrt(int(b+c))
if float.is_integer(d):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
from bisect import bisect_left
n = int(input())
a_list = sorted([int(x) for x in input().split()])
base = a_list[-1] // 2
i = bisect_left(a_list, base)
if i > 0:
    i -= 1
ans = [a_list[-1], a_list[i], abs(a_list[i] - base)]
for i in range(i + 1, n):
    temp = abs(a_list[i] - base)
    if temp >= ans[2]:
        break
    ans[1] = a_list[i]
    ans[2] = temp
print(ans[0], ans[1])
# Judge status: Wrong Answer
n = int(input())
s = input()
t = input()

cnt = 0

if s == t:
    print(n)
    exit()

for i in range(n):
    if s[::-(i+1)] == t[i]:
        cnt += 1
    else:
        break

print(n + n-cnt)
# Judge status: Accepted
N,que=int(input()),[]
for i in range(N):
    s,p=list(input().split())
    que.append((s,-int(p),i+1))
que.sort()
for x in que:
    print(x[-1])
# Judge status: Accepted
n=int(input())
if n<30:
    print('No')
else:
    print("Yes")
# Judge status: Wrong Answer
m=int(input())

pf={}
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1

a=1
b=1
pf=sorted(pf.items(), reverse=True)
#print(pf)
for k,v in pf:
    for i in range(v):
        if a<=b:
            a*=k
        else:
            b*=k
print(a+b-2)
# Judge status: Accepted
a,b,n=map(int,input().split())

ans=-float("inf")
i=0

while True:
    x=b*i-1
    i+=1
    if x>n:
        ans=max(int((a*n)/b)-a*int(n/b), ans)
        print(ans)
        break
    if ans<int((a*x)/b)-a*int(x/b):
        ans=int((a*x)/b)-a*int(x/b)
    else:
        print(ans)
        break
# Judge status: Accepted
import math as m
n,k=map(int,input().split())
a=list(map(int,input().split()))
print(m.ceil((n-1)/(k-1)))
# Judge status: Wrong Answer
a,b=map(int,input().split())
import fractions as f
print(a*b/f.gcd(a,b))
# Judge status: Accepted
n=int(input())
s=list(input())
ans=0
for i in range(1,n+1):
    left_set=set(s[:i])
    right_set=set(s[i:])
    ans=max(ans,(len(left_set & right_set)))

print(ans)
# Judge status: Wrong Answer
import bisect

n, c, k = map(int, input().split())
t = [int(input()) for _ in range(n)]
t.sort()

t_limit = []
for i in range(n):
    t_limit.append(t[i] + k)

cnt = 0
ans_l = []

for i in t_limit:
    ans_l.append(bisect.bisect_left(t, i))

print(len(set(ans_l)))
# Judge status: Wrong Answer
n = int(input())

x = (10**9 + 7)
k=1
for i in range(1,n+1):
  k = k * i

  
  
if k <x:
  print(k)
else:
  print(k % x)
# Judge status: Accepted
#!/usr/local/bin python
# -*- coding: utf-8 -*-
#
# ~/PycharmProjects/atcoder/B-OneDimensionalWorldsTale.py
#

n, y, x, y = map(int, input().split())
x_under = [int(i) for i in input().split()]
y_under = [int(i) for i in input().split()]
max_x_under = max(x_under)
min_y_under = min(y_under)

for z in range(x+1, y+1):
    if max_x_under < z <= min_y_under:
        print("No War")
        exit()

print("War")
# Judge status: Accepted
import bisect
import cmath
import heapq
import itertools
import math
import operator
import os
import random
import re
import string
import sys
from collections import Counter, deque, defaultdict
from copy import deepcopy
from decimal import Decimal
from fractions import gcd
from functools import lru_cache, reduce
from operator import itemgetter, mul, add, xor

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(10 ** 9)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7
# MOD = 998244353




A, B, C = list(map(int, sys.stdin.buffer.readline().split()))
ok = len(set([A, B, C])) == 2
if ok:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
n=int(input())

p=list(map(int,input().split()))
count=0
jugh=0
for i in range(n):
    if p[i]==i+1:
        if jugh!=1:
            jugh=1
            count+=1
        else:
            jugh=0
    else:
        jugh=0

print(count)
# Judge status: Accepted
a,b,m = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
ret = 2**60
for _ in range(m):
  x,y,c = map(int,input().split())
  x -= 1
  y -= 1
  ret = min(ret, A[x]+B[y]-c)
print( min(ret, min(A)+min(B)) )
# Judge status: Wrong Answer
a=input().split()
print(a[0]+a[1])
# Judge status: Wrong Answer
# coding:utf-8
a, b, k = map(int, input().split())

for i in range(a, min(a + k, b)):
    print(i)

for i in range(max(b - k + 1, a + k), b + 1):
    print(i)
# Judge status: Accepted
a, b, c = map(int, input().split())

a, b, c = sorted([a, b, c])

dif_a = c-a
dif_b = c-b
result = dif_b
dif_a -= dif_b
if dif_a%2==0:
    result += dif_a//2
else:
    result -= (-dif_a)//2 - 1
print(result)
# Judge status: Accepted
N = int(input())
S = [input() for _ in range(N)]

for i in range(N):
  S[i] = "".join(sorted(S[i]))

ans = {}
for i in range(N):
  if S[i] in ans:
    ans[S[i]] += 1
  else:
    ans[S[i]] = 1

cnt = 0
for a in ans:
  cnt += ans[a] * (ans[a] - 1) // 2
print(cnt)
# Judge status: Accepted
s=input()
n="keyence"
res=False
if s[:8]==n or s[-7:]==n:
    res=True
else:
    for i in range(7):
        if s[:i+1]+s[i-6:]==n:
            res=True
            break

x="YES" if res else "NO"
print(x)
# Judge status: Accepted
x,y=map(int,input().split())
a=[1,3,5,7,8,10,12]
b=[4,6,9,11]
if ((x in a) and (y in a)) or ((x in b) and (y in b)):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
a, b = map(int, input().split())
s = input()

if s[a] == "-" and s[:a].isdigit() and s[b+1:].isdigit():
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))

ans = 100000
aa = 0
for i in range(n):
    if ans >= abs((T-0.006*H[i])-A):
        ans = abs((T-0.006*H[i])-A)
        aa = i
        
print(i+1)
# Judge status: Accepted
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush

def main():
    S = input()

    if len(S) == len(set(S)):
        print('yes')
    else:
        print('no')


if __name__ == '__main__':
    main()
# Judge status: Accepted
p=d=2019
z=[0]*p
for i,j in enumerate(input()[::-1]):
	d=d+int(j)*pow(10,i,p)
	z[d%p]+=1
r=z[0]
for i in z:
	r+=i*(i-1)//2
print(r)
# Judge status: Wrong Answer
H = int(input())
W = int(input())
N = int(input())
 
upper = H if H >= W else W
 
print((N // upper) + 1)
# Judge status: Accepted
a, b = map(int, input().split())

if (a >= 1) and (a <= 9) and (b >= 1) and (b <= 9):
    print(a * b)
else:
    print(-1)
# Judge status: Wrong Answer
n, k, q = map(int, input().split())
a = [int(input())for i in range(q)]

res = 0
for i in range(1, q+1):
  if k - q + a.count(i) > 0:
    res += 1
print(res)
# Judge status: Wrong Answer
import math
import itertools
from functools import reduce


def gcd(*numbers):
    return reduce(math.gcd, numbers)


K = int(input())
GCD = 0
iterator = itertools.combinations_with_replacement(list(range(1, K+1)), 3)
for (a, b, c) in iterator:
    GCD += gcd(a, b, c)

print(GCD)
# Judge status: Accepted
import sys
N,K = map(int,input().split())
tele = list(map(int,input().split()))
k = 1
flag = [0]*N
goal = tele[0]
miti = [1]
while (flag[goal-1])!=1:
    k += 1
    miti.append(goal)
    flag[goal-1] = 1
    goal = tele[goal-1]
    if k == K:
        print(goal)
        sys.exit()

a = miti.index(goal)
loop = k-a
ans = miti[(K-a)%loop+a]

print(ans)
# Judge status: Accepted
from collections import deque
n,m  = map(int, input().split())
r = [[] for _ in range(n+1)]
ans = [0]*(n+1)
for i in range(m):
  a,b  = map(int, input().split())
  r[a].append(b)
  r[b].append(a)

q = deque([1])
while q:
  fr = q.popleft()
  for i in r[fr]:
    if ans[i] != 0:
      continue
    ans[i] = fr
    q.append(i)
print("Yes")
for i in ans[2:]:
  print(i)
# Judge status: Accepted
n = int(input())
l = [int(x) for x in input().split()] 
dp = [float('inf')] * n  
dp[0] = 0
for i in range(n):
    for j in (i+1, i+2):
        if j < n:
            dp[j] = min(dp[j], dp[i]+abs(l[i]-l[j]))
print(dp[n-1])
# Judge status: Accepted
import sys
input=sys.stdin.readline
n = int(input())
lis = []
lis.append(input()[:-1])
ans = 0
for i in range(n-1):
    word = input()[:-1]
    if word in lis:
        ans += 1
    if word[0] != lis[-1][-1]:
        ans += 2
    lis.append(word)
if ans == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n, m = map(int, input().split())
if n > 2 and m > 2:
  ans = (n-2)*(m-2)
elif n == 2 or m == 2:
  ans = 0
elif n == 1 and m == 1:
  ans = 1
elif n == 1:
  ans = m - 2
elif m == 1:
  ans = n - 2

print(ans)
# Judge status: Accepted
N, K = [int(i) for i in input().split()]

total = 0
win = 0
p = 0.0
for n in range(1, N+1):
  t = n
  c = 0
  while t < K:
    c += 1
    t *= 2
  p += 0.5**c * 1/N
  
print(p)
# Judge status: Accepted
A,N=map(int, input().split())
if N<100:
  print(N*100**A)
else:
  print(101*100**A)
# Judge status: Wrong Answer
d, n = map(int, input().split())
print(n*100**d)
# Judge status: Wrong Answer

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

mean = 0

for i in range(n):
    mean += a[i] - (i + 1)

b = mean // n
ans = 0
for i in range(n):
    ans += abs(a[i] - (b + i + 1))

print(ans)
# Judge status: Wrong Answer
n = int(input())
c = 0
b = 0
for _ in range(n):
  a = int(input())
  if a == 0:
    b = 0
    continue
  c += a // 2
  b = a % 2
print(c)
# Judge status: Accepted
import sys
from collections import Counter

N = int(input())
D = list(map(int, sys.stdin.readline().rsplit()))
C = Counter(D)
mod = 998244353

if D[0] != 0 or C[0] != 1:
    print(0)
    exit()

res = 1
for i in range(1, max(D) + 1):
    if i not in C:
        print(0)
        exit()
    res *= (C[i - 1] ** C[i]) % mod

print(res % mod)
# Judge status: Accepted
n,a,b,c,d=map(int,input().split())
s=input()

if "##" in s[a-1:max(c,d)]:print("No")
elif c>d and "..." not in s[b-2:d+1]:print("No")
else:print("Yes")
# Judge status: Wrong Answer
n = int(input())
b = list(map(int, input().split()))
ans = b[-1]
p = b[-1]
for i in range(n - 2)[::-1]:
    p = min(p, b[i])
    ans += p
print(ans + p)
# Judge status: Accepted
K=int(input())
S=str(input())
if K>=len(S):
    print(S)
else:
    print(S[0:K]+"...")
# Judge status: Accepted
n,m = map(int,input().split())
s = set()
t = set()
for i in range(m):
  a,b = map(int,input().split())
  if a == 1 and b != n:
    s.add(b)
  if a != 1 and b == n:
    t.add(a)
 
if len(s&t) > 0:
  print('POSSIBLE')
else:
  print('IMPOSSIBLE')
# Judge status: Accepted
from itertools import combinations, combinations_with_replacement
from math import sqrt


n = int(input())
ans = [0] * (n + 1)
for x, y, z in combinations_with_replacement(range(1, int(sqrt(n))), 3):
    i = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
    if i <= n:
        if x == y == z:
            ans[i] += 1
        elif all([(s != t) for s, t in combinations([x, y, z], 2)]):
            ans[i] += 6
        else:
            ans[i] += 3

for i in range(1, n + 1):
    print(ans[i])
# Judge status: Accepted
print("YNeos"[set(input())!=set("abc")::2])
# Judge status: Wrong Answer
X = int(input())
ans = 0
for i in range(1,X+1):
    for j in range(2,X+1):
        if i**j <= X:
            ans = max(ans,i**j)
        else:
            break
print(ans)
# Judge status: Wrong Answer
#1
import sys
n = int(input())
a = []
for i in range(n):
    j = int(input())
    a.append(j)
    
point = a[0]
cnt = 1
for i in range(n):
    point = a[point-1]
    cnt +=1
    if point == 2:
        print(cnt)
        sys.exit()
print("-1")
# Judge status: Accepted
ans=float('inf')
n=int(input())
for i in range(1,n):
    z=0
    j=n-i
    c=str(i)+str(j)
    for k in c:
        z+=int(k)
    ans=min(ans,z)
print(ans)
# Judge status: Accepted
a,b=map(int,input().split())
n = input()
m = [0]*a
for i in range(1,a):
  if n[i-1:i+1]=="AC":
    m[i]=m[i-1]+1
  else:
    m[i]=m[i-1]
for j in range(b):
  s,t=map(int,input().split())
  print(m[t-1]-m[s-1])
# Judge status: Wrong Answer
n=int(input())
a=2
b=1
if n==1:
  print(1)
for i in range(n-1):
  if i%2==0:
    a=a+b
  else:
    b=a+b
print(max(a,b))
# Judge status: Accepted
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))

from collections import deque

p = sorted(p)[a-x:]
q = sorted(q)[b-y:]
t = deque(sorted(p+q))
r = deque(reversed(sorted(r)))
# print(t,r)

while r:
    if t[0] < r[0]:
        t.popleft()
        w = r.popleft()
        t.append(w)
    else:
        break

ans = sum(t)
print(ans)
# Judge status: Wrong Answer
#https://atcoder.jp/contests/panasonic2020/tasks/panasonic2020_c
# -*- coding: utf-8 -*-
import math
a,b,c = map(int, input().split())
if a + b + 2*math.sqrt(a*b) < c:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N = int(input())
H = list(map(int, input().split()))

ans = 0
for i, h_std in enumerate(H):
  for h in H[i+1+ans:]:
    if h <= h_std:
      ans += 1
    else:
      break
print(ans)
# Judge status: Wrong Answer
# Python3 (3.4.3)
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# function
# -------------------------------------------------------------


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
A = int(input())
S = input().rstrip()

print("red" if A>=3200 else S)
# Judge status: Accepted
A,B,C,K=[int(i) for i in input().split()]
if K<A:
    P=K
else:
    P=A
    if A+B<K:
        P-=(K-(A+B))
print(P)
# Judge status: Accepted
A, V = [int(n) for n in input().split()]
B, W = [int(n) for n in input().split()]
T = int(input())
 
if V <= W:
    print('NO')
    exit()
    
d = abs(A - B)

if V > W and d <= (V - W) * T:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
import re

sdash = input().replace('?', '.')
t = input()
len_t = len(t)
isNotUsed = True

for i in range(len(sdash) - len_t, -1, -1):
    if re.match(sdash[i:i+len_t], t):
        s = sdash[:i] + t + sdash[i+len_t:]
        isNotUsed = False
        break
if isNotUsed:
    print('UNRESTORABLE')
else:
    print(s.replace('.', 'a'))
# Judge status: Accepted
n, m = map(int, input().split())
a = list(map(int, input().split())) # list()でリスト化、それを変数に代入。

print(max(n-sum(a),-1))
# Judge status: Accepted
from collections import Counter
n=int(input())
s=[input() for _ in range(n)]
d=Counter(s)
m=max(d.values())
keys = [k for k,v in d.items() if v==m]
print("\n".join(sorted(keys)))
# Judge status: Accepted
n = int(input())
words = ['a', 'b', 'c', 'd', 'e', 'f','g','h', 'i', 'j']
ans = [[] for _ in range(n)]
ans[0].append(["a", 1])
for i in range(n - 1):
    for ai in ans[i]:
        for j in range(ai[1]):
            ans[i + 1].append([ai[0] + words[j], ai[1]])
        ans[i + 1].append([ai[0] + words[ai[1]], ai[1] + 1])

for a in ans[n - 1]:
    print(a[0])
# Judge status: Accepted
from collections import deque
n,m = map(int,input().split())
g = [[] for i in range(n)]
for i in range(m):
    x,y = map(int,input().split())
    g[x-1].append(y-1)
    g[y-1].append(x-1)
a = [-1]*n
d = deque([0])
while d:
    f = d.popleft()
    for o in g[f]:
        if a[o] == -1:
            a[o] = f
            d.append(o)
print("Yes")
for i in a[1:]:print(i+1)
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
if b<=c:
    print('0')
elif b<=d:
    print(abs(b-c))
else:
    print(min(b-a,d-c))
# Judge status: Accepted
n,c,k=map(int,input().split())
t=sorted([int(input()) for _ in range(n)])
bc=[1]
bt=[t[0]+k]
for i in range(1,n):
  if bc[-1]<c and t[i]<=bt[-1]<=t[i]+k:bc[-1]+=1
  else:
    bc+=[1]
    bt+=[t[i]+k]
print(len(bt))
# Judge status: Accepted
N, K = map(int, input().split())
H = [int(input()) for _ in range(N)]
H.sort()
minim = 1e10
for i in range(N-K+1):
    minim = min(minim, H[i+K-1] - H[i])
print(minim)
# Judge status: Wrong Answer
d = input()
if d==25:
    print('Christmas')
if d==24:
    print('Christmas Eve')
if d==23:
    print('Christmas Eve Eve')
if d==22:
    print('Christmas Eve Eve Eve')
# Judge status: Accepted
n, d = map(int, input().split())
A = []
for i in range(n):
    a = list(map(int, input().split()))
    A.append(a)

def dstnc(X, Y):
    res = 0
    for l, x in enumerate(X):
        res += (x - Y[l])**2
    return res


ans = 0
for i in range(n - 1):
    for j in range(i + 1, n):
        su = dstnc(A[i], A[j])**0.5
        if str(su)[-1] == "0" and str(su)[-2] == ".":
            ans += 1
print(ans)
# Judge status: Wrong Answer
from operator import itemgetter
a = ("a", "b", "c", "d", "e")
N = int(input())
L = [0]*N

alpha=list('abcdefghij')
print('a'*N)
for i in range(N,0,-1):
    for j in range(i,N,1):
        L[j]+=1
        print(''.join([alpha[i] for i in L]))
# Judge status: Wrong Answer
x,y = map(int, input().split())
for i in range(1, x + 1):
    turu = i
    kame = x - i
    if turu * 2 + kame * 4 == y:
        print('Yes')
        exit()
print('No')
# Judge status: Accepted
def main():
    h1, m1, h2, m2, k = map(int, input().split())
    a = h1*60+m1
    b = h2*60+m2
    print(b-a-k)

if __name__ == "__main__":
    main()
# Judge status: Accepted
from itertools import combinations_with_replacement
n,m,q=map(int,input().split())
a,b,c,d=[0]*q,[0]*q,[0]*q,[0]*q
for i in range(q):
    x,y,z,w=map(int,input().split())
    x-=1
    y-=1
    a[i],b[i],c[i],d[i]=x,y,z,w
ans=0
for v in combinations_with_replacement(range(1,m+1),n):
    res=0
    for i in range(q):
        if v[b[i]]-v[a[i]]==c[i]:
            res+=d[i]
    ans=max(ans,res)
print(ans)
# Judge status: Accepted
A,B=tuple(int(i) for i in input().split(" "))
err=lambda X:abs(int(X*0.08)-A)+abs(int(X*0.10)-B)
rg=[int(A/0.08),int(B/0.10)]
rg.sort()
rg[0]-=int(1/0.08)
rg[1]+=int(1/0.08)
solv=[X for X in range(*rg) if err(X)==0]
solv.sort()
if(len(solv)==0):
    print("-1")
else:
    print(solv[0])
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
a.sort()
amax=max(a)
dp=[True]*(amax+1)
ans=0
for i in range(n):
    if dp[a[i]]:
        ans+=1
        for j in range(a[i],amax+1,a[i]):
            dp[j]=False
        if i<n-1:
            if a[i]==a[i+1]:
                ans-=1
print(ans)
# Judge status: Accepted
import math
n, m = map(int, input().split())
ans = 0
if n == m:
  ans = (math.factorial(n) * math.factorial(m)) * 2
elif  n + 1 == m or n == m + 1:
  ans = (math.factorial(n) * math.factorial(m))
else:
  ans = 0
ans = ans % (10 ** 9 + 7)
print(ans)
# Judge status: Accepted
s = input()
record = list(s)
n = 0
high_score = 0
yesterday = ' '
for today in record :
    ####### main
    if today == 'R':
        if yesterday == 'R' :
            n += 1
        else :
            n = 1
    ###### ato
    if high_score < n :
        high_score = n
    yesterday = today
print(high_score)
# Judge status: Wrong Answer
a,b,c=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき


if (a+b+c)%3==0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a, b = map(int, input().split())

if (a % 2 == 0 ) or ( b % 2 == 0 ) :
	'even'
else :
	'odd'
# Judge status: Accepted
k, x = list(map(int, input().split()))
print(' '.join([str(i) for i in range(x-k+1,x+k)]))
# Judge status: Wrong Answer
from collections import defaultdict

N = int(input())


def fun(x, y, z):
  return x**2 + y**2 + z**2 + x*y + y*z + z*x

res = defaultdict(int)

for x in range(1, 50):
  for y in range(1, 50):
    for z in range(1, 50):
      res[fun(x, y, z)] += 1
        
for n in range(1, N+1):
  print(res[n])
# Judge status: Accepted
N = int(input())
n = N
fs = {}
f = 2
while n > 1:
  if f*f > n:
    if n not in fs:
      fs[n] = 0
    fs[n] += 1
    n = 1
  elif n%f == 0:
    if f not in fs:
      fs[f] = 0
    fs[f] += 1
    n = n//f
  else:
    f += 1
#print(fs)
rs = []
for f in fs:
  n = fs[f]
  for r in range(1, 256):
    if (r+1)*(r+2)//2 > n:
      rs.append(r)
      break
r = sum(rs)
print(r)
# Judge status: Accepted
N,M = map(int, input().split())
res = [0]*M
for i in range(N):
    A = list(map(int, input().split()))
    K = A[0]
    for j in range(1,K+1):
        res[A[j]-1] += 1
print(res.count(N))
# Judge status: Accepted
A, B, X = map(int, input().split())
if A > X:
    print('NO')
else:
    if X >= A + B:
        print('NO')
    else:
        print('YES')
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))
a.sort()
a.append(0)
ans=0
b=a[0]
c=0
for i in range(N+1):
  if b!=a[i]:
    if c<b:
      ans+=c
    b=a[i]
    c=1
  else:
    if c==b:
      ans+=1
    else:
      c+=1
print(ans)
# Judge status: Accepted
import numpy as np
N = int(input())
h = list(map(int, input().split()))


memo = np.full(N, 10**4)
memo[0] = 0
memo[1] = abs(h[0] - h[1])
for i in range(2, N):
    memo[i] = min([memo[i-1] + abs(h[i-1] - h[i]), memo[i-2] + abs(h[i-2] - h[i])])
print(memo[N-1])
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))
 
days = sum(A)
 
if days <= N:
    print(N-days)
else:
    print(-1)
# Judge status: Accepted
n,m,q=map(int,input().split())
query=[]
for _ in range(q): query.append(list(map(int,input().split())))
ans=0
def rec(a):
    if len(a)==n+1:
        temp=0
        for qu in query:
            if a[qu[1]]-a[qu[0]]==qu[2]: temp+=qu[3]
        global ans
        ans=max(ans,temp)
        return
    for i in range(a[-1],m+1):
        cp=a[:]
        cp.append(i)
        rec(cp)
rec([1])
print(ans)
# Judge status: Wrong Answer
n = int(input())
s = list(input())
ans = 0
for i in range(1,n):
  ans = max(ans,min(len(set(s[:i])),len(set(s[i:]))))
print(ans)