peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
#!/usr/bin/env python3
import sys
input = sys.stdin.readline

n, k = map(int, input().split())
a = [int(item) for item in input().split()]

for a1, a2 in zip(a, a[k:]):
    if a1 < a2:
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
import numpy as np
def main():
    N,W = map(int,input().split())
    w,v = [],[]
    for _ in range(N):
        w_,v_ = map(int,input().split())
        w.append(w_)
        v.append(v_)

    dp = np.zeros((N+1,W+1),dtype=np.int64)
    for i in range(N):
        tmp = np.zeros(W+1,dtype=int)
        tmp[w[i]:] = dp[i][:-w[i]] + v[i]
        dp[i+1] = np.maximum(dp[i],tmp)

    print(dp[N][W])
main()
# Judge status: Wrong Answer
x=int(input())
count=0
hap=list(map(int,input().split()))
count=max(hap)
k=hap.index(count)
for i in range(1,x):
    hap=list(map(int,input().split()))
    m=-1
    for j in range(len(hap)):
        if j!=k:
            if hap[j]>=m:
                m=hap[j]
                ano=j
    count+=m
    k=ano
print(count)
# Judge status: Accepted
number = int(input())
tall = list(map(int, input().split()))
addition = 0
for each in range(1, number):
    difference = tall[each - 1] - tall[each]
    if difference >= 0:
        addition += difference
        tall[each] += difference
print(addition)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
print('Yes' if (b - a) == (c - b) else 'No')
# Judge status: Accepted
x,y=map(int,input().split())
k=x
cnt = 0
while k<=y:
  k*=2
  cnt+=1
print(cnt)
# Judge status: Wrong Answer
n = input()
if len(n) == 6: print(90909)
if len(n) == 5: print(909 + int(n) - 9999)
if len(n) == 4: print(909)
if len(n) == 3: print(9 + int(n) - 99)
if len(n) == 2: print(9)
else: print(int(n))
# Judge status: Accepted
if int(input()) in (3,5,7):
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
N = int(input())
l = [ int(x) for x in input().split()]


def oddProblem(l):
    count = 0
    for i in range(N):
        if (l[i] % 2 != 0 and i % 2 != 0):
            count += 1
    return count

print(oddProblem(l))
# Judge status: Accepted
A,B = map(int,input().split())
for x in range(1,10001):
  if (0.1*x)//1 == B and (0.08*x)//1 == A:
    print(x)
    exit(0)
print(-1)
# Judge status: Accepted
N=int(input())
P=list(map(int,input().split()))
ans=0
mini=10**6
for p in P:
    if p<=mini:
        mini=p
        ans+=1
print(ans)
# Judge status: Accepted
a=sorted(map(int,input().split()))
k=int(input())
print(a[0]+a[1]+a[2]*2**k)
# Judge status: Accepted
s = str(input())
flag = 0
C_count = 0
flag_2 = 0
mode = 0
a = 0
b = 0
c = 0
k = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
if s[0] == "A":
  a += 1
for i in s[2:-1]:
  if i == "C":
    C_count += 1
if C_count == 1:
  b += 1

l = s[1:]
l = l.replace("C","")
if l.islower() == True:
  c += 1
if a == 1 and b == 1 and c == 1:
  print("AC")
else:
  print("WA")
# Judge status: Accepted
N = int(input())
ARR = list(map(int,input().split()))



def calculate(n, arr):
    currentHeight = arr[0]
    result = 0
    for i in range(1,n):
        if arr[i] < currentHeight:
            result += (currentHeight - arr[i])
        else:
            currentHeight = arr[i]

    return result

res = calculate(N, ARR)

print(res)
# Judge status: Accepted
a, b, c = map(int, input().split())
answer = "NO"
for x in range(b):
    if (a * (x + 1)) % b == c: answer = "YES"
print(answer)
# Judge status: Accepted
N = int(input())
A = [int(x) for x in input().split()]
numberdict = dict()
for i in range(N):
    if A[i] in numberdict:
        numberdict[A[i]] += 1
    else:
        numberdict[A[i]] = 1
ans = 0
for j in numberdict.keys():
    if numberdict[j] >= j:
        ans += numberdict[j] - j
    else:
        ans += numberdict[j]
print(ans)
# Judge status: Wrong Answer
from functools import reduce
n = int(input())
a = list(map(int, input().split()))

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

def gcd_list(ns):
    return reduce(gcd, ns)

ans = 0
l=len(a)
for i in range(l):
    b = a[0:i] + a[i+1:l]
    ans = max(ans, gcd_list(b))
    print(b)

print(ans)
# Judge status: Accepted
s = input()
if "a" in s and "b" in s and "c" in s:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,a,b = map(int,input().split())
mx = a + (n-1)*b
mi = (n-1)*a + b
ans = mx - mi + 1
if n == 1 and a != b or a > b:
  print(0)
else:
  print(ans)
# Judge status: Accepted
G={chr(a+ord("a")):a for a in range(26)}
H={G[b]:b for b in G}

T=input()
S=[]
for s in T:
    S.append(G[s])
K=int(input())

I=0
N=len(S)
for i in range(N):
    if (i<N-1) and (26-S[i]<=K) and S[i]!=0:
        K-=26-S[i]
        S[i]=0
    elif i==N-1:
        S[i]=(S[i]+(K%26))%26

U=""
for s in S:
    U+=H[s]

print(U)
# Judge status: Accepted
x=int(input())
for a in range(120):
 for b in range(-99,a):
  if a**5-b**5==x:print(a,b);exit()
# Judge status: Accepted
s = str(input())
a  = set(s)
if len(a) == 3:
	print('Yes')
else:
	print('No')
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
s=[0]*(N+1)
for i in range(N): s[i + 1]=s[i]+A[i]
C=[0]*(N);C[0]=abs(A[0]-(s[N]-s[0]));x=10**9;p=0
for i in range(1,N):
  if N-i==1:
    break
  else:
    C[i]=abs(C[i-1]+A[i]-(s[N]-s[i]))
    if x>C[i]:
      x=C[i]
      p=i
print(abs(C[p-1]+A[p]-(s[N]-s[p])))
# Judge status: Accepted
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 0
ans = 0
inf = float("inf")

N = int(input())
k = 0
while k * (k+1) // 2 < N:
  k += 1
while N > 0:
  print(min(k, N))
  N -= min(k, N)
  k -= 1
# Judge status: Wrong Answer
n,m = map(int,input().split())
t = [0 for i in range(n)]
b = ""
a = True
for i in range(m):
    s,c = map(int,input().split())
    if t[s-1] == 0 or t[s-1] == c:
        t[s-1] = c
    else:
        a=False
for i in range(n):
    b += str(t[i])
if a and b[0]!='0':
    print(b)
else:
    print(-1)
# Judge status: Accepted
a, b, c = map(int, input().split())
if c-(a-b) < 0:
    print(0)
else:
    print(c-(a-b))
# Judge status: Accepted
n = int(input())
robots = []
for _ in range(n):
  x, l = map(int, input().split())
  robots.append((x+l, x-l))
robots.sort()

hand = robots[0][0]
count = 1
for robot in robots[1:]:
  if hand <= robot[1]:
    hand = robot[0]
    count += 1
print(count)
# Judge status: Accepted
N=int(input())
k=0
while 2**k <= N:
    ans = 2**k
    k += 1
print(ans)
# Judge status: Accepted
n,k=map(int,input().split())
s,p,r=map(int,input().split())
a=list(input())
count={}
count["s"]=s
count["p"]=p
count["r"]=r
ans=0

for i in range(k):
    for j in range(i,n,k):
        if j-k>=0 and a[j-k]!=a[j]:
            ans+=count[a[j]]
        if j-k>=0 and a[j-k]==a[j]:
            a[j]="q"
        elif j-k<0:
            ans+=count[a[j]]
        
print(ans)
# Judge status: Wrong Answer
X,Y = map(int,input().split())
print(X + Y / 2)
# Judge status: Accepted
import bisect
N, M, K = [int(_) for _ in input().split()]
A = [int(_) for _ in input().split()]
B = [int(_) for _ in input().split()]

A_sum = [0]
a_sum = 0
for a in A:
  a_sum += a
  A_sum.append(a_sum)
B_sum = [0]
b_sum = 0
for b in B:
  b_sum += b
  B_sum.append(b_sum)

ans = 0
for i in range(N+1):
  b_time = K - A_sum[i]
  if b_time < 0:
    break
  idx = bisect.bisect_right(B_sum, b_time)
  ans = max(ans, i + idx-1)
print(ans)
# Judge status: Wrong Answer
nm = input().split()

n = nm[0]
m = nm[1]

if n < m :
	print('No')
else:
	print('Yes')
# Judge status: Accepted
n,x,*a=map(int, open(0).read().split())
a.sort()
for i in range(n):
    x-=a[i]
    if x<0:
      print(i)
      exit()
    elif x==0:
      print(-~i)
      exit()
print(n-1)
# Judge status: Accepted
N = int(input())
B = list(map(int, input().split()))
A = [0]*N
A[0] = B[0]
for i in range(N-1):
    if i == N-2:
        A[i+1] = B[i]
    else:
        A[i+1] = min(B[i], B[i+1]) 
print(sum(A))
# Judge status: Accepted
#<B>
N = int(input())
ans = 0
for i in range(1, N + 1):
    if len(str(i)) % 2 == 1:
        ans += 1

print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
if n >= m // 2:
    print(m // 2)
else:
    print(n + (m - 2 * n) // 4)
# Judge status: Accepted
K=int(input())
from collections import deque

#queue = list(range(1,10))
queue = deque(list(range(1,10)))

for i in range(K):
  lunlun = queue.popleft()
  #print(lunlun)
  last = lunlun%10
  if last!=0:
    queue.append(10*lunlun+last-1)
  queue.append(10*lunlun+last)
  if last!=9:
    queue.append(10*lunlun+last+1)

print(lunlun)
# Judge status: Accepted
def get_half_dividers(n):
    return {i for i in range(1, int(n ** 0.5) + 1) if n % i == 0}


N = int(input())

dividers = get_half_dividers(N)
print(min([max(0, d - 1) + max(0, (N // d) - 1) for d in dividers]))
# Judge status: Wrong Answer
n = int(input())
ans = 0
for i in range(1, n+1):
	L = int(str(i)[0])
	R = int(str(i)[-1])
	if L * R == 0:
		continue
	if L == R:
		ans += 1
	cur = 10
	dig = R*cur + L
	while dig <= n:
		ans += cur // 10
		cur *= 10
		dig = R*cur + L
print(ans)
# Judge status: Wrong Answer
a, b = map(int, input().split())

if (a + b) % 2 == 1:
    print((a + b) / 2 + 1)
else:
    print((a + b) / 2)
# Judge status: Accepted
from math import pi
r = int(input())
print(2*r*pi)
# Judge status: Wrong Answer
k,s = map(int,input().split())
ans = 0
for i in range(k+1):
    for j in range(k+1):
        if (s-(i+j)) <= k:
            ans += 1
print(ans)
# Judge status: Wrong Answer
N=int(input())
S=input()

idx="none"
count=0
flag=0
for i in range(N-1,-1,-1):
    if flag and S[i]=="#":
        count+=1

    elif S[i]==".":
        if not flag:
            idx=i
        flag=1
if idx=="none":
    print(0)
else:
    #print(count,idx)
    print(min(count,idx+1-count))
# Judge status: Wrong Answer
N = int(input())
res = 1
i = 1
while i**2 < N:
    res = i**2
    i += 1
print(res)
# Judge status: Accepted
n = int(input())
L = [0]*(110**2*6+1)

for i in range(1,110):
    for j in range(1,110):
        for k in range(1,110):
            a = i**2 + j**2 + k**2 + i*j +j*k + k*i
            if a <= n:
                L[a-1] +=1
for i in range(n):
    print(L[:n+1][i])
# Judge status: Accepted
n,m=map(int,input().split())
A = [list(input()) for i in range(n)]
B = [list(input()) for i in range(m)]
for i in range(n-m+1):
  for j in range(n-m+1):
    flag = True
    for k in range(m):
      if A[k+j][i:i+m] != B[k][:]:
        flag = False
        break
    if flag:
      print("Yes")
      quit()
else:
  print("No")
# Judge status: Accepted
n,x = map(int,input().split())
l = list(map(int,input().split()))
ans = 0
i = 0

for _ in range(n):
    ans = ans + l[i]
    if ans <= x:
        i += 1
    
print(i+1)
# Judge status: Accepted
N = int(input())
dic = {}
for i in range(N):
    s = input()
    if s in dic:
        dic[s] += 1
    else:
        dic[s] = 1
M = int(input())
dic2 = {}
for i in range(M):
    s = input()
    if s in dic2:
        dic2[s] += 1
    else:
        dic2[s] = 1
ans = 0
for k,v in dic.items():
    tmp = v
    for k2,v2 in dic2.items():
        if k == k2:
            tmp -= v2
    ans = max(tmp,ans)
print(ans)
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

count = 0

for i in range(N):
    if B[i] >= A[i] + A[i+1]:
        count += A[i] + A[i+1]
        A[i+1] = 0
    else:
        count += B[i]

print(count)
# Judge status: Accepted
a, b = map(int, input().split())
m = b - a # [m-1] と [m]
t = 0
for i in range(m):
  t += i
print(t - a)
# Judge status: Accepted
K, N = list(map(int, input().split()))
A = list(map(int, input().split()))
A.append(K+A[0])
diff_list = []
for i in range(len(A) - 1):
    diff_list.append(A[i+1]-A[i])
print(K - max(diff_list))
# Judge status: Accepted
A, B, C = map(int, input().split())
s = 0
ans = "NO"

for i in range(100):
    s = B * i + C
    if s % A == 0:
        ans = 'YES'
        break

print(ans)
# Judge status: Wrong Answer
import math
A=list(input())
N=len(A)
x=0
for i in range(0,N):
    if A[i]!=A[N-1-i]:
        x+=1
a=math.ceil(x/2)
print(x)
# Judge status: Accepted
n,y=map(int,input().split())
count=0
for i in range(n+1):
  for j in range(n+1):
    k=n-i-j
    if k>=0 and k<=n:
      if i*10000+j*5000+k*1000==y:
        print(i,j,k)
        exit()
print(-1,-1,-1)
# Judge status: Accepted
a = list(input())
if all(i=='9' for i in a[1:]):
    print(9*len(a)-9+int(a[0]))
elif len(a)==1:
    print(a[0])
else:
    print(max(int(a[0])-1, 0)+9*(len(a)-1))
# Judge status: Wrong Answer
n = int(input())
s = input()
s_ = s.replace('()', '')
x = s_.count('(')
y = s_.count(')')
print('('*y+s+')'*x)
# Judge status: Wrong Answer
# 20200612_yorukatsu_e.py
import collections
N = int(input())
A = list(map(int,input().split()))
C = collections.Counter(A)
ans = 0
for i,v in C.items():
    print(i,v)
    if i!=v:
        if i<v:
            ans += v-1
        else:
            ans += v
print(ans)
# Judge status: Accepted
n = int(input())
P = [int(x)-1 for x in input().split()]
subs = [0]*n
for p in P:
    subs[p] += 1
print(*subs, sep='\n')
# Judge status: Accepted
k, s = map(int, input().split())
ans = 0
for i in range(k+1):
    for j in range(k+1):
        if 0 <= s - i - j <= k:
            ans += 1
print(ans)
# Judge status: Accepted
numbers = []
for _ in range(6):
    numbers.append(int(input()))
predicted_value = "Yay!"
k_distance = numbers[-1]
antenas = numbers[:-1]
antenas.sort()
if antenas[-1] - antenas[0] > k_distance:
    predicted_value = ":("
print(predicted_value)
# Judge status: Wrong Answer

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

print((a*b*c)/2)
# Judge status: Wrong Answer
A,B=map(int,input().split())
if (A+B)>24:
  print(A+B-24)
else:
  print(A+B)
# Judge status: Accepted
import sys
input = sys.stdin.readline

K, N = map(int, input().split())
A = list(map(int, input().split()))
d = []

for i in range(N-1):
    d.append(A[i+1]-A[i])

d.append(K+A[0]-A[-1])

print(K-max(d))
# Judge status: Accepted
N, K = list(map(int, input().split()))

res = 0

for i in range(N+1)[1:]:
  j = 0
  while i*(2**j) < K:
    j += 1
  res += (1/N) * ((1/2) ** j)

print(res)
# Judge status: Accepted
import math
s = int(input())
t = int(math.sqrt(s) // 1)
if s == t**2:
    print(0, 0, 0, t, t, 0)
else:
    t += 1
    e = t * t - s
    print(0, 0, t, e, 1, t)
# Judge status: Accepted
from collections import Counter

n = int(input())
a = [int(input()) for _ in range(n)]
cnt = 0

for i, n in Counter(a).items():
    if n % 2 == 1:
        cnt += 1

print(cnt)
# Judge status: Accepted
a = int(input())
b = int(input())
if a == 1:
  if b == 2:
    print(3)
  else:
    print(2)
elif a == 2:
  if b == 1:
    print(3)
  else:
    print(1)
else:
  if b == 2:
    print(1)
  else:
    print(2)
# Judge status: Accepted
# https://atcoder.jp/contests/cf17-final/tasks/cf17_final_b

s = input()
a = b = c = 0
for i in range(len(s)):
    if s[i] == 'a':
        a += 1
    elif s[i] == 'b':
        b += 1
    else:
        c += 1
if abs(a - b) <= 1 and abs(b - c) <= 1 and abs(c - a) <= 1:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
def f(n):
    return (n//2)*(n%2==0) + (3*n+1)*(n%2==1)

def main():
    s = int(input())
    sets = set([])
    lists = []
    m = 0
    for _ in range(pow(10,5)):
        lists.append(s)
        sets.add(s)
        if len(sets) != len(lists):
            break
        s = f(s)
        m += 1
    print(m+1)


if __name__ == "__main__":
    main()
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int, input().split()))

count = Counter(a)
ans = 0
for k,v in count.items():
  if k < v: ans += v-k
  elif v < k: ans += v
print(ans)
# Judge status: Wrong Answer
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    sp=[]
    for i in range(n):
        s,p=STRM()
        sp.append([s,p,i+1])
    sorted_sp1=sorted(sp, key=lambda x:x[1], reverse=True)
    sorted_sp2=sorted(sorted_sp1, key=lambda x:x[0])
    for i in range(n):
        print(sorted_sp2[i][2])
    
if __name__ == '__main__':
    do()
# Judge status: Accepted
N = int(input())
data = list(map(int,input().split()))
ans = [0] * N
for d in data:
    ans[d-1]+=1
for a in ans:
    print(a)
# Judge status: Accepted
a,b=map(int,input().split())
c=list(input())
c=c[:b-1]+[c[b-1].swapcase()]+c[b:]
print("".join(c))
# Judge status: Accepted
from collections import Counter
N = int(input())
A = list(map(int, input().split()))
c = Counter(A)
l = sorted(filter(lambda x:x[1] > 1,c.items()),reverse=True)

if len(l) == 0:
  print(0)
else:
  if l[0][1] >= 4:
    print(l[0][0]**2)
  else:
    print(l[0][0]*l[1][0])
# Judge status: Wrong Answer
# 整数A,B,Cを入力
A,B,C = map(int,input().split())
# 整数CがA以上かつB以下であればYes,そうでなければNo
if A <= B and B <= C:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
A,B,C = map(int,input().split())

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")
# Judge status: Accepted
# ABC165 A

def main():
    k = int(input())
    a, b = map(int, input().split())

    res = False

    for i in range(a, b+1):
        if i % k == 0:
            print('OK')
            res = True
            break
    
    if res == False:
        print('NG')

if __name__ == '__main__':
    main()
# Judge status: Accepted
a,b,c=map(int,input().split())
print("YES" if b-a==c-b else "NO")
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
d = {str(i+1):a[i] for i in range(n)}
d = dict(sorted(d.items(),key=lambda x:x[1]))
ans = list(d.keys())
print(" ".join(ans))
# Judge status: Accepted
# agc004_a.py
A,B,C = map(int,input().split())
if A%2 == 0 or B%2 == 0 or C%2 == 0 :
    print(0)
    exit()
L = abs(A*B*(C//2) - (A*B*(C-C//2)))
N = abs(A*C*(B//2) - (A*C*(B-B//2)))
M = abs(C*B*(A//2) - (C*B*(A-A//2)))

print(min(L,N,M))
# Judge status: Accepted
w,h,n = map(int,input().split())
ww=hh=0
for _ in [0]*n:
    x,y,a = map(int,input().split())
    if a == 1:
        ww = max(ww,x)
    elif a == 2:
        w = min(w,x)
    elif a == 3:
        hh = max(hh,y)
    else:
        h = min(h,y)
print((w-ww)*(h-hh)*(w>ww)*(h>hh))
# Judge status: Wrong Answer
x = int(input())
num = 0
for i in range(1,40000):
    num += i
    if num >= x:
        print(i)
        exit()
# Judge status: Accepted
k=int(input())

q=["1","2","3","4","5","6","7","8","9"]
x=9
for i in q:
    if x>100000:
        break
    x+=1
    a=i[-1]
    for j in ([-1,0,1]):
        bb=int(a)+j
        if bb<10 and bb>=0:
            q.append(i+str(bb))


print(q[k-1])
# Judge status: Wrong Answer
n, m = map(int,input().split())
ans = [1]*m

for i in range(1,n+1):
    x = list(map(int,input().split()))
    x.pop(0)
    for j in range(m):
        if j not in x:
            ans[j-1] = 0

print(ans.count(1))
# Judge status: Accepted
mod=10**9+7
n,a,b=map(int,input().split())
ans=pow(2,n,mod)-1

def comb(n,mm):
  m=min(mm,n-mm)
  ans=1
  for i in range(m):
    ans*=n-i
    ans%=mod
  for i in range(m):
    ans*=pow(i+1,mod-2,mod)
    ans%=mod
  return ans

ans=((ans+(mod-comb(n,a)))%mod)+(mod-comb(n,b))
print(ans%mod)
# Judge status: Accepted
h1, m1, h2, m2, k = map(int, input().split())

hm1 = h1*60+m1
hm2 = h2*60+m2

print(hm2-hm1-k)
# Judge status: Accepted
import itertools
N=int(input())
p=list(map(int,input().split()))
q=list(map(int,input().split()))

m=list(itertools.permutations(p))
m.sort()

p=tuple(p)
q=tuple(q)
a=m.index(p)
b=m.index(q)

print(abs(a-b))
# Judge status: Accepted
import re
s=input()
if re.fullmatch(r'(hi)+',s):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n = int(input()) 
def yakusu(num):
    list_a = []
    for i in range(1, num//2 + 1):
        if num % i == 0:
            list_a.append(i)
    list_a.append(num)
    return list_a
  
ans = 0
for i in range(1, n + 1):
    if len(yakusu(i)) == 8 and i % 2 ==1:
        ans += 1
        
print(ans)
# Judge status: Accepted
from collections import Counter
n = int(input())
*a, = map(int,input().split())
b = Counter(a)

c = sorted(b.items(), reverse = True)
z = [0] * 2
j = 0
ans = 0
for keys,values in c:
    if values < 2:continue
    if values >= 4:
        ans = max(ans, keys ** 2)
    if j < 2:
        z[j] = keys
        j += 1
    ans = max(ans, z[0] * z[1])
print(ans)
# Judge status: Accepted
S = input()
cnt=0
ans = 0
sets = {"A","T","C","G"}
for s in S:
  if s in sets:
    cnt += 1
  else:
    ans = max(ans,cnt)
    cnt = 0
ans = max(ans,cnt)
print(ans)
# Judge status: Wrong Answer
k=int(input())
c=0
x=0
for c in range(7):
  x=x+7*10**c
  if x%k==0:
    print(c+1)
    break
  if c==6:
    print(-1)
# Judge status: Accepted
import math
N, A , B = map(int, input().split())

ans = 0

for x in range(1, N + 1):
    SUM = 0
    num = x
    while x > 0:
        SUM += (x % 10)
        x //= 10
    if A <= SUM <= B:
        ans += num

print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-

H = int(input())
W = int(input())
N = int(input())

longer = max(H, W)

count = int(N / longer)
if N % longer > 0:
    count += 1

print(count)
# Judge status: Wrong Answer
A = []
for i in range(3):
  a = input().split()
  a = [int(num) for num in a]
  A.append(a)

N = int(input())
b = [int(input()) for i in range(N)]

for i in range(3):
  for j in range(3):
    if b.count(A[i][j]) != 0:
      A[i][j] = 0
    else:
      continue

if (sum(A[0][:]) or sum(A[1][:]) or sum(A[2][:])
   or sum(A[:][0]) or sum(A[:][1]) or sum(A[:][2])
   or (A[0][0]+A[1][1]+A[2][2]) or (A[0][2]+A[1][1]+A[2][0])) == 0:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import sys

input = sys.stdin.readline


def main():
    AB, BC, CA = map(int, input().split())
    ans = AB * BC // 2
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
s=input()
print("x"*len(s))
# Judge status: Accepted
import sys
input=lambda: sys.stdin.readline().rstrip()
n,d=map(int,input().split())
ans=0
for _ in range(n):
  x,y=map(int,input().split())
  if x**2+y**2<=d**2:
    ans+=1
print(ans)
# Judge status: Accepted
s=input()
l=["Sunny","Cloudy","Rainy"]
index=l.index(s)
index+=1
if index==3:
    index=0
print(l[index])
# Judge status: Accepted
n,T=map(int,input().split())
ans=10000
for i in range(n):
  c,t=map(int,input().split())
  if t<=T:
    ans=min(ans,c)

if ans==10000:
  print("TLE")
else:
  print(ans)
# Judge status: Accepted
N = int(input())
A = [int(input()) for _ in range(N)]

total = sum(A)
if total%10 == 0:
  A.sort()
  for a in A:
    if a%10 != 0:
      total -= a
      break
  else: # 全部が10の倍数
    total = 0
print(total)
# Judge status: Accepted
X = int(input())

if X >= 30:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
def solve(n):
    ans = 0
    for i in range(1,n+1):
        y = n//i
        ans += (y*(y+1)*i)/2
    return ans

def main():
    n = int(input())
    print(int(solve(n)))

if __name__ == "__main__":
    main()
# Judge status: Accepted
h,m,h2,m2,k = map(int,input().split())

end = h2*60+m2
stt = h*60+m

print(end-stt-k)
# Judge status: Accepted
N = input()

c = N[0]
ans = int(c) + 9 * (len(N) - 1)
if int(N) < int(c + '9' * (len(N) - 1)):
    ans -= 1
print(ans)
# Judge status: Accepted
N,M,X = [int(hoge) for hoge in input().split()]
CE = [[int(hoge) for hoge in input().split()] for n in range(N)]
curmin = 100000000000000000
ans = -1
for i in range(2**12):
    A = [0]*M
    cost = 0
    for n,CA in enumerate(CE):
        if (i >> n) & 1:
            cost += CA[0]
            for m in range(M):
                A[m] += CA[m+1]
    if all([x >= X for x in A]):
        curmin = min(curmin,cost)
        ans = curmin
print(ans)
# Judge status: Wrong Answer
N, K = map(int, input().strip().split())
p = list(map(int, input().strip().split()))
p.sort()
print(sum(p[:K+1]))