peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n, c, k = map(int, input().split())
t = []
for i in range(n):
    t.append(int(input()))
t.sort()
ans = 0
counter = 0
lim = t[0]
for i in range(n):
    if counter < c and (t[i] - lim) < k:
        counter += 1
    else:
        bus = []
        counter = 0
        lim = t[i]
        ans += 1
print(ans + 1)
# Judge status: Wrong Answer
N, M = [int(i) for i in input().split(' ')]
A = [int(i) for i in input().split(' ')]
print("N:", N, "M:", M)
print("A:", A)
for i in range(M):
    max_value = max(A)
    A[A.index(max_value)] = max_value // 2
print(sum(A))
# Judge status: Wrong Answer
A,B,C = map(int,input().split())
if (A+B+C)%2 == 0:
    candidates = [i for i in range(0,151,6)]
else:
    candidates = [i for i in range(3,151,6)]
for i in candidates:
    x = i/3
    if A<= x and B<= x and C<=x and ((x-A)+(x-B)+(x-C))%2==0:
        print(int((i-(A+B+C))/2))
        break
# Judge status: Accepted
a,b,x = map(int, input().split())

if a > x:
  print('NO')
elif a+b < x:
  print('NO')
else:
  print('YES')
# Judge status: Wrong Answer
inp = input()
part1 = inp[0:int((len(inp)-1)/2)]
part2 = inp[int((len(inp)+1)/2):]


def isParin(S):
    n = len(S)
    flg = 0
    for i in range(int(n/2)):
        if S[i] != S[n-1-i]:
            flg += 1
    if flg == 0:
        return True
    else:
        return False


if isParin(inp):
    if isParin(part1) and isParin(part2):
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
n,m = map(int,input().split())

menu = [i for i in range(1,m+1)]
cnt = [0]*m
a = []

for i in range(n):
    ka = list(map(int,input().split()))
    ka.pop(0)
    a.append(ka)
    
for i in menu:
    for j in a:
        if i in j:
            cnt[i-1] += 1
            
print(cnt.count(n))
# Judge status: Accepted
# -*- coding: utf-8 -*-
# スペース区切りの整数の入力
N, A, B = map(int, input().split())
# 文字列の入力
#s = input()
#print(s[0:K-1]+s[K-1].lower()+s[K:N])
i=1
ans=0
while(i<=N):
    s=str(i)
    array=list(map(int,s))
    #print(sum(array))
    SUM=sum(array)
    if A<=SUM and SUM<=B:
        #print(i)
        ans=ans+i
    i=i+1

print(ans)
# Judge status: Wrong Answer
a,b=input().split()
for i in a,b:
  print(i,end="")
# Judge status: Accepted
n,k = map(int,input().split())
t = [0] * n

for _ in range(k):
    d = int(input())
    a = list(map(int,input().split()))

    for e in a:
        t[e-1] += 1
ans = 0
l = [i for i in t if i == 0]
# print(l)
print(len(l))
# Judge status: Accepted
n = int(input())

count = 0
for i in range(1, n+1):
  if i % 3 != 0 and i % 5 != 0:
    count += i
print(count)
# Judge status: Accepted
S = list(input())
T = list(input())

def compare(s, t):
    if len(s) != len(t): return False
    res = True
    for i in range(len(s)):
        res &= (s[i] == t[i] or s[i] == '?')
    return res

n = len(S)
m = len(T)
pos = -1
for i in range(n):
    if compare(S[i:i+m], T):
        pos = i

if pos == -1:
    print('UNRESTORABLE')
else:
    S[pos:pos+m] = T
    S = ''.join(S)
    S = S.replace('?', 'a')
    print(S)
# Judge status: Wrong Answer
from collections import deque
S=deque(input())
q=int(input())
for i in range(q):
  c=list(input().split())
  print(c)
  if c[0]=='1':
    S.reverse()
  elif c[0]=='2':
    if c[1]=='1':
      S.appendleft(c[2])
    elif c[1]=='2':
      S.append(c[2])
ans=''.join(S)
print(ans)
# Judge status: Accepted
x=int(input())
if x==1:
  	print(0)
elif x==0:
  	print(1)
# Judge status: Accepted
A,B,C = map(int,input().split())
cnt=0

if A==B==C:
  if A%2==0:
    cnt=-1
  else:
    cnt=0
else:
  while A%2==0 and B%2==0 and C%2==0:
    s=A//2
    t=B//2
    u=C//2
    A=t+u
    B=u+s
    C=s+t
    cnt +=1
    
print(cnt)
# Judge status: Wrong Answer
from collections import defaultdict

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

memo = defaultdict(int)
ans = 0
for i, h in enumerate(A, start=1):
    ans += memo[h+i]
    memo[i-h] += 1

print(ans)
# Judge status: Accepted
L, R = map(int, input().split())
target = R+1
if R - L > 2018:
    target = L + 2018
mi = 2019
for i in range(L,target):
    for j in range(i+1,target):
        mi = min(mi,(i*j)%2019)
print(mi)
# Judge status: Accepted
a = int(input())
print(a*(a**2 + a +1))
# Judge status: Accepted
sx,sy,tx,ty=map(int,input().split())

iki=["U" for i in range(ty-sy)]+["R" for i in range(tx-sx)]
kaeri=["D" for i in range(ty-sy)]+["L" for i in range(tx-sx)]
iki2=["L"]+["U" for i in range(ty-sy+1)]+["R" for i in range(tx-sx+1)]+["D"]
kaeri2=["R"]+["D" for i in range(ty-sy+1)]+["L" for i in range(tx-sx+1)]+["U"]
ans=iki+kaeri+iki2+kaeri2
print(*ans,sep="")
# Judge status: Accepted
t=""
for x in input():
    if x=="B":
      t=t[:-1]
    else:t+=x
print(t)
# Judge status: Wrong Answer
N=int(input())
A=list(map(int, input().split()))
for i in range(N):
  if A[i]%2==0:
    if A[i]%3==0 or A[i]%5==0:
      print('APPROVED')
      exit()

print('DENIED')
# Judge status: Wrong Answer
n1 = [1, 3, 5, 7, 8, 10, 12]
n2 = [4, 6, 9, 11]
n3 = [2]
nums = [map(int, input().split())]
print("Yes" if nums in n1 or nums in n2 or nums in n3 else "No")
# Judge status: Accepted
a, b, c = map(int,input().split())

print("YES" if b-a == c-b else "NO")
# Judge status: Accepted
a,b,c = map(int,input().split())

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

print(anli[2] * 10 + anli[1] +anli[0])
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-

a = int(input())
b = a % 1000

print(b)
# Judge status: Accepted
s = list(input())
s = sorted(s)
if s[0] == s[1] and s[2] == s[3] and s[0] != s[2]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
def readinput():
    s=input()
    return s

def main(s):
    y=int(s[:4])
    m=int(s[5:7])
    d=int(s[9:])
    if m<=4:
        return 'Heisei'
    else:
        return 'TBD'

if __name__=='__main__':
    s=readinput()
    ans=main(s)
    print(ans)
# Judge status: Wrong Answer
H = list(map(int,input().split()))

h = H[2]-H[0]
m = H[3]-H[1]

if h < 0:
    h = h + 24

if m < 0:
    h -= 1
    m *= -1

mini = h*60 + m - H[4]

if mini < 0:
    mini = 0

print(mini)
# Judge status: Accepted
import re
n, a, b, c, d = map(int, input().split())
s = input()
for i in range(a-1, c-1):
  if s[i] + s[i+1] == "##":
    print("No")
    exit()
for i in range(b-1, d-1):
  if s[i] + s[i+1] == "##":
    print("No")
    exit()
if c < d:
  print("Yes")
else:
  f = False
  for i in range(b-2, min(d-1, n-2)):
    if s[i] + s[i+1] + s[i+2] == "...":
      f = True
  if f:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
from collections import Counter
n, k = map(int, input().split())
A = list(map(int, input().split()))
cnt = Counter(A)
alt = sorted(cnt.values(), reverse=True)
print(sum(alt[k:]))
# Judge status: Wrong Answer
from sys import stdin
input = stdin.readline


def main():
  N = int(input())

  nz = 0
  i = 1
  while True:
    if N//(5**i)//2 > 0:
      nz += (N//(5**i)//2)
      i += 1
    else:
      break

  print(nz)


if(__name__ == '__main__'):
  main()
# Judge status: Wrong Answer
n=int(input())
a=[int(i) for i in input().split()]
b=[int(i) for i in input().split()]
c=[int(i) for i in input().split()]
ans=0

for i in range(n-1):
    if a[i]+1==a[i+1]:
        ans+=c[i-1]
print(ans+sum(b))
# Judge status: Wrong Answer
S=input()
if S[0:1]==S[1:2]==S[2:3]:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
def main ():
    n,m = map(int, input().split())
    ab = [list(map(int, input().split())) for _ in range(m)]
    g = [[] for _ in range(n+1)]
    for a,b in ab:
        g[a].append(b)
        g[b].append(a)
    if set(g[1]) & set(g[n]) != set([]):
        print('POSSIBLE')
    else:
        print('IMPOSSIBLE')


if __name__ == '__main__':
    main()
# Judge status: Accepted

def resolve():
    S = int(input())

    x1, y1 = 0, 0
    x2, y2 = 1, 10 ** 9

    x3 = (S + y2 - 1) // y2
    y3 = x3 * y2 - S

    print(x1, y1, x2, y2, x3, y3)


if __name__ == "__main__":
    resolve()
# Judge status: Accepted
N, M = map(int, input().split())
MOD = int(1e9) + 7


def factorial_cor(n):
    fact = 1
    for integer in range(1, n + 1):
        fact = (fact * integer) % MOD
    return fact


if abs(N - M) >= 2:
    print(0)
else:
    if abs(N - M) == 1:
        print((factorial_cor(N) * factorial_cor(M))%MOD)
    else:
        print(((factorial_cor(N) * factorial_cor(M))*2)%MOD)
# Judge status: Accepted
N,A,B=list(map(int,input().split()));print(A*(N//(A+B))+min([N%(A+B),A]))
# Judge status: Accepted
N,K = map(int, input().split())
A = list(map(int, input().split()))
    
l,r = 0, max(A)
while r-l>1:
  mid = (l+r)//2
  cnt = 0
  for i in range(N):
    if A[i]%mid!=0:
      cnt+= A[i]//mid
    else:
      cnt += A[i]//mid - 1
            
  if cnt <= K:
    r = mid
  else:
    l = mid
print(r)
# Judge status: Accepted
s=list(input())
ans=0
for i in range(len(s)-1):
    if s[i]==s[i+1]:
        if s[i+1]=='0':
            s[i+1]='1'
        else:
            s[i+1]='0'
        ans+=1

print(ans)
# Judge status: Wrong Answer
N,A,B=map(int,input().split())
ans=0
 
if (B-A)%2==0:
  ans=(B-A)//2
else:
  if A-1<N-B:
    if B-A==1:
      ans=B-1
    else:
      ans=A+(B-A-1)//2
  else:
    if B-A==1:
      ans=N-A
    else:
      ans=N-B-1+(A+N-B-1)//2
print(ans)
# Judge status: Accepted
N=int(input())
r=int((2*N+.25)**0.5 + 0.5)
l=r*(r+1)//2-N
[print(i) for i in list(range(1,r+1)) if i!=l]
# Judge status: Accepted
import math
n=int(input())
print(math.ceil(n/111)*111)
# Judge status: Wrong Answer
import numpy as np
N,K=map(int,input().split())
P=list(map(int,input().split()))
Q=[]
def ex(A):
  return (1+A)/2.0
for i in range(N):
  Q.append(ex(P[i]))
Q=np.array(Q)
R=Q.cumsum()
ans=0
for i in range(K,N):
  S=R[i]-R[i-K]
  if ans<S:
    ans=S
print(ans)
# Judge status: Accepted
import math
N,K=map(int,input().split())
A=list(map(int,input().split()))
print(math.ceil((N-K)/(K-1))+1)
# Judge status: Wrong Answer
a,b,c = map(int,input().split())
for i in range(600):
  if a == b and b == c:
    break
  a,b,c = a//2, b//2, c//2
  a, b, c = b + c, a + c, a + b
ans = i if i < 600 else -1
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
n = int(input())
s = input()
w = s.count(".")
b = 0
ans = w
for i in s:
    b += i =="#"
    w -= i == "."
    ans = min(ans, w+b)
print(ans)
# Judge status: Accepted
import collections

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

c = collections.Counter(a)

for i in range(1,n+1):
    if c[i]:
        print(c[i])
    else:
        print(0)
# Judge status: Accepted
N,M=map(int,input().split())
op=[list(map(int,input().split())) for _ in range(M)]
susflag=[0]*N
susflag[0]=1
num=[1]*N
fr=0
to=0
#print(susflag,num)
for i in range(M):
    fr=op[i][0]-1
    to=op[i][1]-1
    num[fr]=num[fr]-1
    num[to]=num[to]+1
    if susflag[fr]==1:
        susflag[to]=1
    if num[fr]==0:
        susflag[fr]=0
    #print(susflag,num)
print(sum(susflag))
# Judge status: Accepted
w, a, b = map(int, input().split())
if a <= b:
    print(max(0, b-a-w))
else:
    print(max(0, a-b-w))
# Judge status: Accepted
N,M,K = map(int,input().split())
A=list(map(int,input().split()))
B=list(map(int,input().split()))

a,b = [0],[0]

for i in range(N):
  a.append(a[i]+A[i])
for i in range(M):
  b.append(b[i]+B[i])
  
ans = 0
j = M

for i in range(N+1):
  if a[i] > K:
    break
  while b[j] > K - a[i]:
    j -= 1
  ans = max(ans,i+j)

print(ans)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
x = int(input())

ans = 0
for i in range(a+1):
    for j in range(b+1):
        nc = (x - 500*i - 100*j) // 50
        if nc < 0 or c < nc:
            continue
        ans += 1

print(ans)
# Judge status: Wrong Answer
n=int(input())
a=[int(i)for i in input().split()]
res=[str(a[i]) for i in range(n)]
print(" ".join(res))
# Judge status: Accepted
n,m=map(int,input().split())
print(int(n*(n-1)/2+m*(m-1)/2))
# Judge status: Accepted
x = int(input())
c = 1
for b in range(1, x):
    for p in range(2, x):
        if b**p <= x:
            c = max(c, b**p)
        else:
            break
print(c)
# Judge status: Wrong Answer
from fractions import gcd
N, M = map(int, input().split())
a = list(set(map(int,input().split())))
flag = 0
x = 1
for i in range(len(a)):
  a[i] = a[i] / 2
  if a[i] % 2 == 0:
    flag = 1
    print(0)
    break
  x = (x * a[i]) // gcd(x, a[i])
if flag == 0:
  print(int((M // x + 1) // 2))
# Judge status: Accepted
q, h, s, d = map(int, input().split())
n = int(input())
cost = 0

q_ef = q*8
h_ef = h*4
s_ef = s*2

if min(q_ef, h_ef, s_ef, d) == d:
    cost += d * (n//2)
    n %= 2

if min(q_ef, h_ef, s_ef) == q_ef:
    cost += q * (n*4)
elif h_ef <= s_ef:
    cost += h * (n*2)
else:
    cost += s * n

print(cost)
# Judge status: Accepted
x = int(input())

a = x // 11
b = x % 11 
if b >6:
    c = 2
elif b == 0:
    c = 0
else:
    c = 1    
print(2*a+c)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

n = int(input())
a = n // 100
if a == 7:
    print("Yes")
b = (n - a*100) // 10
if b == 7:
    print("Yes")
c = (n - a*100 - b*10)
if c == 7:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,k=map(int,input().split())
a=list(map(int,input().split()))
visited={}
for i in range(1,n+1):
    visited[i]=-1
l=[1]
visited[1]=0
i=1
while True:
    if visited[a[l[i-1]-1]]==0:
        roop_start=l.index(a[l[i-1]-1])
        break
    visited[a[l[i-1]-1]]=0
    l.append(a[l[i-1]-1])
    i+=1
roop_dif=i-roop_start

if k<roop_start:
    print(l[k])
else:
    k-=roop_start
    k%=roop_dif
    print(l[roop_start+k])
# Judge status: Accepted
import sys
from collections import Counter
input = sys.stdin.readline
N = int(input())
c = Counter()
for _ in range(N): c[input()[: -1]] += 1
print("AC x", c["AC"])
print("WA x", c["WA"])
print("TLE x", c["TLE"])
print("RE x", c["RE"])
# Judge status: Wrong Answer
N = int(input())
H = list(map(int,input().split()))

hardle = 0
ans = "Yes"
for i in H:
  if hardle>i:
    ans = "No"
    break
  else:
    if i>hardle:
      hardle-=1
print(ans)
# Judge status: Accepted
n=int(input())
a=[0]*(3*n)
a=list(map(int,input().split()))
a=sorted(a,reverse=True)
ans=0
#print(a)
for i in range(n):
  ans+=a[2*i+1]
print(ans)
# Judge status: Accepted
d,t,s= map(int, input().split())

if d/s<=t:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n, k = map(int, input().split())
a = [int(i) for i in input().split()]

if len(a) == k:
  print(1)
  exit()

print(((len(a)-1) //( k -1)) + 1)
# Judge status: Accepted
n=int(input())
ans=0
if n%2==1:
    ans=0
else:
    tmp=10
    while tmp<=n:
        ans+=n//tmp
        tmp*=5
print(ans)
# Judge status: Accepted
n=int(input())

t = list(map(int,input().split()))

count = 0

for i in range(n-2):
    A = t[i:i+3]
    #print(A)
    y = A[1]
    A.sort()

    if y == A[1]:
        count += 1
print(count)
# Judge status: Wrong Answer
import math

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

ans = 0

for x in range(0, a * n, b):
  new = math.floor(x / b) - a * math.floor((x / a) / b)
  if new > ans:
    ans = new

print(ans)
# Judge status: Accepted
s = list(input())
n = len(s)
ok = True
for i in range(n):
    if i % 2 == 0:
        if s[i] == 'L':
            ok = False
    else:
        if s[i] == 'R':
            ok = False

if ok:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
#coding: utf-8
import math
N = int(input())
L = []
for i in range(N-1):
    l = list(map(int,input().split()))
    L.append(l)

for i in range(N-1):
    t = 0
    for j in range(i,N-1):
        l = L[j]
        c = l[0]
        s = l[1]
        f = l[2]
        if t <= s:
            t = s+c
        else:
            n = math.ceil((t-s)/f)
            t = s+n*f+c
    print(t)

print(0)
# Judge status: Accepted
from bisect import bisect_left, bisect_right
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
ans = 0

for j in b:
    i = bisect_left(a, j)
    k = bisect_right(c, j)
    ans += i*(n-k)
    #print(j, a, i)
    #print(j, c, k)
print(ans)
# Judge status: Wrong Answer
w, a, b = map(int , input().split())
if b>=a and b<=w+a:
	print(0)
if b+w<a:
	print(a-(b+w))
elif a+w<b:
	print(b-(a+w))
# Judge status: Accepted
def m(a,b):
    n=3
    L=[0]*3
    for i in range(n):
        L[i]=a[i]-b[i]
    return L

def f(L):
    return len(set(L))==1

C=[]
for i in range(3):
    C.append(list(map(int,input().split())))

F=True
for i,j in [(0,1),(1,2),(2,0)]:
    F&=f(m(C[i],C[j]))

if F:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,m,x,y=map(int,input().split())
a=list(map(int, input().split()))
b=list(map(int, input().split()))
res="War"
for i in range(x+1,y+1):
    if max(a)<i<=min(b):
        res="No War"
        break
print(res)
# Judge status: Accepted
N=int(input())
W=list(map(int,input().split()))
for i in range(N-1,0,-1):
  if W[i-1]>W[i]+1:
    print("No")
    exit()
  elif W[i-1]==W[i]+1:
    W[i-1]-=1
print("Yes")
# Judge status: Accepted
s = 'HAKUTYUMU' + input()
 
 
while s != 'HAKUTYUMU':
    next_s = s
 
    if s[-5:] == 'dream':
        next_s = s[:-5]
    if s[-7:] == 'dreamer':
        next_s = s[:-7]
    if s[-5:] == 'erase':
        next_s = s[:-5]
    if s[-6:] == 'eraser':
        next_s = s[:-6]
 
    if s == next_s:
        print('NO')
        exit()
 
    s = next_s
 
print('YES')
# Judge status: Accepted
a,b,x=map(int, input().split())

print("YES" if a<=x and a+b>=x else "NO")
# Judge status: Accepted
n,k,s = map(int,input().split())
if n>=k:
  if s <10**9:
    print(*([s]*k+[10**9]*(n-k)))
    exit()
  else:
    print(*([s]*k+[1]*(n-k)))
    exit()
# Judge status: Accepted
import sys

n, k = map(int, input().split())
d = list(map(int, input().split()))

nums = [i for i in range(10)]
canuse = []

for i in nums:
    if i not in d:
        canuse.append(i)

for i in range(n,n*10):
    x = 0
    for j in str(i):
        if int(j) not in canuse:
            break
        else:
            x += 1
            if x == len(str(i)):
                print(i)
                sys.exit()
# Judge status: Accepted
a,b=map(int,input().split())
if a <=b:
  print(a)
else:
  print(a-1)
# Judge status: Accepted
a, b, c = map(int, input().split())
if b - a == c - b:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n, k = map(int, input().split())
h = sorted(int(input()) for _ in range(n))
ans = float('inf')
for i in range(n-k+1):
    c = h[i+k-1] - h[i]
    ans = min(ans, c)
print(ans)
# Judge status: Accepted
n = int(input())

s = ''
while True:
    if n % 2 == 0:
        s = '0' + s
        n = n // -2
    else:
        s = '1' + s
        n = (n - 1) // -2
    if n == 0:
        break
print(s)
# Judge status: Accepted
a=list(map(int, input().split()))
lis=set(a)
if len(lis) == 2:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
X = list(map(int,input().split()))
for i,x in enumerate(X):
    if x == 0:
        print(i+1)
        exit(0)
# Judge status: Accepted
a=int(input())
A = sorted(list(map(int, input().split())))

ans =0
for i in range(a):
  for j in range(i):
    for k in range(j):
      if(A[k] != A[j] and A[i] != A[j] and A[k] + A[j]>A[i]):
        ans+=1

print(ans)
# Judge status: Wrong Answer
x=int(input())
for i in range(1,1001):
  if 100*i<=x<105*i:
    print(1)
    break
else:
  print(0)
# Judge status: Wrong Answer
h,a=map(int,input().split())

i=h%a

t=h-i
print(int(t/a+1))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()


def main():
    n, m = map(int, input().split())
    if n == 1 and m == 1: ans = 1
    elif m == 1: ans = n - 2
    elif n == 1: ans = m - 2
    else: ans = (m - 2) * (n - 2)
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
n = input()
dp = [0,1]
ans = 0
for i in range(len(n)):
    cur1 = dp[0]
    cur2 = dp[1]
    if i != len(n)-1:
        dp[0] = min(cur1+int(n[i]), cur2+10-int(n[i]))
        dp[1] = min(cur1+int(n[i])+1, cur2+9-int(n[i]))
    else:
        ans = min(dp[0]+int(n[i]), dp[1]+10-int(n[i]))
print(ans)
# Judge status: Wrong Answer
n = list(map(int,input().split()))
ans = 10**9
l = []
for i in range(n[0]):
  l.append(list(map(int,input().split())))
for i in range(n[0]):
  if l[i][1] <= n[1]:
    ans = min(l[i][0],ans)
print(ans)
# Judge status: Accepted
from collections import Counter
w=list(input())
a=Counter(w)
b=list(a.values())

for i in range(len(b)):
    if b[i]%2!=0:
        print("No")
        exit()
else:
    print("Yes")
# Judge status: Accepted
import sys, heapq

N = int(input())
H = list(map(int, sys.stdin.readline().rsplit()))

pre = H[0] - 1
for i in range(1, N):
    h = H[i]
    if h - pre > 0:
        pre = h - 1
    elif h - pre == 0:
        pre = h
    else:
        print("No")
        exit()

print("Yes")
# Judge status: Wrong Answer
n = int(input())
al = list(map(int, input().split()))
a_2 = 0
a_4 = 0
a_not4 = 0

for a in al:
    if a % 4 == 0:
        a_4 += 1
    elif a == 2:
        a_2 += 1
    else:
        a_not4 += 1

if n % 2 == 0:
    if (a_4 + a_2//2) >= a_not4:
        print('Yes')
    else:
        print('No')
else:
    if (a_4 + a_2//2 + 1) == a_not4 or (a_4 + a_2//2) > a_not4:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
n = int(input())
h = tuple(map(int, input().split()))

c = [0] * n
c[0] = 0
c[1] = abs(h[0] - h[1])

for i in range(2, n):
    c[i] = min(c[i - 1] + abs(h[i - 1] - h[i]), c[i - 2] + abs(h[i - 2] - h[i]))

print(c[-1])
# Judge status: Accepted
n = int(input())
def solve(n): 

    string = ""
    i = 0
    while n > 0: 
        rem = n % 26
        if rem == 0: 
            string += 'z'
            i += 1
            n = (n // 26) - 1
        else: 
            string += str(chr((rem - 1) + ord('a')))
            i += 1
            n = n // 26
    string = string[::-1] 
    print(string)

solve(n)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
my_list = [a, b, c]
if (a == b != c) and (a != b == c): print("Yes")
else: print("No")
# Judge status: Accepted
import itertools
a=[]
for i in range(5):
    a.append(int(input()))
out=sum(a)+50
ls = list(itertools.permutations(range(5)))
for i in ls:
    t=0
    for j in i:
        if t%10 != 0:
            t+=10-t%10
        t+=a[j]
    if t <=out:
        out=t
print(out)
# Judge status: Accepted
A = map(int, input().split())
print(len(set(A)))
# Judge status: Accepted
N = int(input())
s = [''.join(sorted(input())) for _ in range(N)]

d = {}
for i in s:
  if i not in d:
    d[i] = 1
  else:
    d[i] += 1

ans = 0
for i in d.values():
  ans += i*(i-1)//2
print(ans)
# Judge status: Accepted
X,Y=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
print(X+Y//2)
# Judge status: Accepted
s = input()
k = int(input())

for i in range(k):
    if s[i] != "1":
        print(s[i])
        exit()

print(1)
# Judge status: Wrong Answer
n = int(input())
t=[0]
x=[0]
y=[0]
for i in range(n):
    _t, _x, _y = map(int, input().split())
    t.append(_t)
    x.append(_x)
    y.append(_y)

flag = 0
for i in range(1,n+1):
    dt = t[i] - t[i-1]
    dx = x[i] - x[i-1]
    dy = y[i] - y[i-1]
    dist = abs(dx) + abs(dy)
    if dist > dt:
        flag = flag +1
    elif dist % 2 != 0 and dt % 2 != 0:
        flag = flag +1
else:
    print("Yes" if flag ==0 else "No")
# Judge status: Wrong Answer
n=int(input())
arr=[int(input())-1 for _ in range(n)]
if arr[0]==1:
    print(-1)
else:
    step = 0
    curr=arr[0]
    while True:
        if step>n:
            print(-1)
            break
        else:
            if curr == 1:
                print(step+1)
                break
            else:
                curr = arr[curr]
                step += 1
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))

def gcd(a,b): return a if b==0 else gcd(b,a%b)

L=[0]*(N+1)
R=[0]*(N+1)

for i in range(N-1):
    L[i+1]=gcd(L[i],A[i])
    R[i+1]=gcd(R[i],A[N-i-1])

ans=1
for i in range(1,N+1):
    ans=max(ans,gcd(L[i-1],R[N-i]))
print(ans)
# Judge status: Accepted
(A,B)=input().split()
(A,B)=(int(A),int(B))
if 1<=A<=9 and 1<=B<=9:
  print(A*B)
else:
  print(-1)
# Judge status: Accepted
import math
a, b, c, d = map(int, input().split())
e = c*d//math.gcd(c,d)
def ko(a,b,c):
  x = b//c-a//c
  if a%c==0:
    x+=1
  return(x)
print(b-a+1-ko(a,b,c)-ko(a,b,d)+ko(a,b,e))