peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
N = int(input())
li = [int(input()) for i in range(N)]

for index, i in enumerate(li):
  new = sorted(li)
  
  s = max(li)
  
  if s == li[index]:
    print(new[1])
  else:
    print(s)
# Judge status: Accepted
#!/usr/bin/env python

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

    cnt = 0
    min_ = 0
    max_ = 0

    for i in range(1, n+2):
        min_ += i - 1
        max_ += n - i + 1

        if i >= k:
            cnt += max_ - min_ + 1
            cnt %= 10 ** 9 + 7

    print(cnt)


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

import math

to_make, at_most, batch_time = map(int, input().split())

batches = math.ceil(to_make / at_most)
print(batch_time * batches)
# Judge status: Wrong Answer
R=int(input())
ans=R*3.14159
print(ans)
# Judge status: Accepted
s = list(input())
t = list(input())


s.sort()
t.sort(reverse=True)

if ''.join(s) < ''.join(t):
  print('Yes')
else:
  print('No')
# Judge status: Wrong Answer
from itertools import accumulate

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

cumsum = list(accumulate(lst))

mi = 2 * 10 ** 9
su = cumsum[-1]
for i in cumsum:
  mi = min(mi, abs(su - 2 * i))
print(mi)
# Judge status: Wrong Answer
n=int(input())
h=list(map(int,input().split()))
f=1
for i in range(n-2):
    if h[i+1]-h[i]<-1 or h[i+2]-h[i+1]<-1:
        f=0
        break
    if h[i+1]-h[i]<=0 and h[i+2]-h[i+1]<0:
        f=0
        break
       
if f:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
A1,A2,A3 = map(int,input().split())

if (A1+A2+A3)>=22:
    print('bust')
else:
    print('win')
# Judge status: Accepted
N, K = map(int, input().split())
P = list(map(int, input().split()))

next_end = K

num = sum(P[:next_end])

max_num = num

for start in range(1, N - K + 1):
    num -= P[start - 1]
    num += P[next_end]
    max_num = max(num, max_num)
    next_end += 1

print((max_num + K) / 2)
# Judge status: Accepted
s=input()
if s[2]==s[3] and s[4]==s[5]:
    print("Yes")
    exit()
print("No")
# Judge status: Accepted
x,y = map(int,input().split())
nsum = x
ans = 1
while(nsum<=y):
    nsum=nsum*2
    if(nsum>y):
        break
    ans += 1
print(ans)
# Judge status: Wrong Answer
a=5
if 1<a and a <10:
    print(a+a**2+a**3)
# Judge status: Wrong Answer
import numpy as np
n,k,q = map(int, input().split())
a = [int(input()) for _ in range(q)]
point_list  = np.array([k] * n)

for i in a:
    print(point_list)
    point_list -= 1
    point_list[i-1] += 1

for i in point_list:
    if i >0:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
mod = 10**9 + 7

def ncr(n, r):
    r = min(r, n-r)
    x, y = 1, 1
    for i in range(r):
        x = (x * (n-i)) % mod
        y = (y * (i+1)) % mod
    
    return x * pow(y, mod-2, mod) % mod


X, Y = map(int, input().split())


if 2*Y - X < 0 or 2*X - Y < 0 or (2*Y - X) % 3 != 0 or (2*X - Y) % 3 != 0:
    print("0")
else:
    M = (2*Y - X) // 3
    N = (2*X - Y) // 3
    print(ncr(M+N,N))
# Judge status: Wrong Answer
S=input()
L=[0,0,0]
for i in range(len(S)):
    if S[i]=="a":
        L[0]+=1
    elif S[i]=="b":
        L[1]+=1
    else:
        L[2]+=1
        
L.sort()
if L[2]-L[0]<=1:
    print("Yes")
else:
    print("NO")
# Judge status: Accepted
a,b,c = map(int, input().split())

tmp =int(b/a)

if tmp > c:
    print(c)
else:
    print(tmp)
# Judge status: Accepted
n,m = map(int,input().split())
l,r = [],[]
for i in range(m):
    a,b = map(int,input().split())
    l.append(a)
    r.append(b)
num = list(range(1,n+1))
lmax = max(l)
rmin = min(r)
if lmax > rmin:
    print(0)
else:
    gate = set(range(lmax,rmin+1))
    ans = list(set(num) & gate)
    print(len(ans))
# Judge status: Accepted
from fractions import gcd
import sys
input = sys.stdin.readline
MOD = 10 ** 9 + 7


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

    l = A[0]
    for i in range(1, N):
        l = l * A[i] // gcd(l, A[i])

    print(sum([l // a for a in A]) % MOD)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
a,b,c,d = map(int, input().split())

if b < 0:
    if c > 0:
        print(b*c)
    else:
        print(a*c)
elif a < 0:
    if d < 0:
        print(a*c)
    elif c < 0:
        print(max(a*c,b*d))
    else:
        print(b*d)
else:
    if d < 0:
        print(b*c)
    else:
        print(b*d)
# Judge status: Accepted
S = str(input())
T = str(input())
ans = 1000
for i in range(len(S) - len(T) + 1):
    c = 0
    for j in range(len(T)):
        if S[i] != T[j]:
            c += 1
        i += 1
    ans = min(ans, c)
print(ans)
# Judge status: Wrong Answer
a = int(input())
b = int(input())
h = int(input())
s = (a + b) * h / 2
print(s)
# Judge status: Accepted
N=int(input())
dp=[float("inf")]*(10**5+10)
dp[0]=0
for i in range(1,N+1):
	dp[i]=1+dp[i-1]
	X=6
	Y=9
	j=1
	k=1
	while(i>=X**j):
		dp[i]=min(dp[i],1+dp[i-X**j])
		j+=1
	while(i>=Y**k):
		dp[i]=min(dp[i],1+dp[i-Y**k])
		k+=1
print(dp[N])
# Judge status: Accepted
def evenstring(s) : 
  while len(s) > 0 : 
    s = s[ : -2]
    t1 = s[ : int(len(s) / 2)]
    t2 = s[int(len(s) / 2) : ]
    if t1 == t2 : 
      return len(t1) + len(t2)
  

s = input()

print(evenstring(s))
# Judge status: Accepted
def solve():
    X, Y = [int(i) for i in input().split()]
    ans = 0
    while X <= Y:
        ans += 1
        X *= 2
    print(ans)


if __name__ == "__main__":
    solve()
# Judge status: Accepted
N = int(input())
A = map(int, input().split())

A_plus = []
A_minus = []

for a in A:
    if a >= 0:
        A_plus.append(a)
    else:
        A_minus.append(a)

A_plus = sorted(A_plus)
A_minus = sorted(A_minus)


if len(A_minus) % 2 == 0:
    res = sum(A_plus) - sum(A_minus)
else:
    if len(A_plus) > 0:
        res = sum(A_plus) - sum(A_minus) - 2*min(A_plus[0], (-1)*A_minus[-1])
    else:
        res = sum(A_plus) - sum(A_minus) + 2*A_minus[-1]

print(res)
# Judge status: Accepted
lst = ["1","2","3"]
for i in range(2):
  lst.remove(input())
print(lst[0])
# Judge status: Accepted
s = input()
n = len(s)

if "keyence" == s:
    print("YES")
    exit()

for i in range(n):
    for j in range(i+1, n):
        if s[:i] + s[j:] == "keyence":
            print("YES")
            exit()

print("NO")
# Judge status: Wrong Answer
n = int(input())

mx_dis1, mn_dis1 = 0, 10**9
mx_dis2, mn_dis2 = 0, 10**9
for i in range(n):
    x, y = map(int, input().split())
    dis1 = x + y
    dis2 = x - y
    mx_dis1 = max(dis1, mx_dis1)
    mn_dis1 = min(dis1, mn_dis1)
    mx_dis2 = max(dis2, mx_dis2)
    mn_dis2 = min(dis2, mn_dis2)

ans1 = mx_dis1 - mn_dis1
ans2 = mx_dis2 - mn_dis2

print(max(ans1, ans2))
# Judge status: Accepted
A, B, C = map (int, input().split())

print(min(C, B // A))
# Judge status: Wrong Answer
A,B = map(int,input().split())

if (A + B) % 3 == 0 and (A + B)//3 == A and (A + B)//3 == B and (A + B)//3 == A + B:
	print("Yes")
else:
	print("No")
# Judge status: Accepted
print(len(set(map(int, input().split(' ')))))
# Judge status: Accepted
a,b,c = map(int,input().split())
if a + b > c:
    print('No')
    exit()
if ((c - a - b) ** 2) - 4 * a * b > 0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
N = int(input())
a = list(map(int, input().split()))
X1, X2, X3 = 0, a.count(0), a.count(1)
count = X1 + X2 + X3
ans = 0
for i in range(2, max(a) + 1):
  count -= X1
  X1, X2, X3 = X2, X3, a.count(i)
  count += X3
  ans = max(ans, count)
else:
  print(ans)
# Judge status: Accepted
from collections import Counter

N = int(input())
S = input()
counter_s = Counter(S)
min_stone = counter_s.most_common()[-1][1]
if min_stone == N:
    min_stone = 0
A, B = 0, counter_s['.']
for s in S:
    if s == '#':
        A += 1
    else:
        B -= 1
    if min_stone > A+B:
        min_stone = A+B
print(min_stone)
# Judge status: Accepted
N, K = map(int, input().split())
num = list(range(N+1))
count = 0
base_minimum = sum([i for i in num[:K]])
base_maximum = sum([i for i in num[-K:]])
count += base_maximum - base_minimum + 1

for k in range(K, N+1):
    base_minimum += num[k]
    base_maximum += num[-k-1]
    count += base_maximum - base_minimum + 1
    
print(int(count%(1e9+7)))
# Judge status: Accepted
input_line = input().split()
input_line = [int(s) for s in input_line]
print(str(input_line[2]) + " " + str(input_line[0]) + " " + str(input_line[1]))
# Judge status: Wrong Answer
import math
n,m=map(int,input().split())
mod=10**9+7
a=math.factorial(n)*math.factorial(m)
if abs(n-m)==0:
    print(2*a%mod)
elif abs(n-m)>1:
    a=0
print(a%mod)
# Judge status: Wrong Answer
n=int(input())
A=list(map(int,input().split()))
B=[0,0,0,0,0,0,0,0]
red=int(0)
for i in range(n):
    now=int(A[i]/400)
    if now<8:
        B[now]=1
    else:
        red+=1

ans=B.count(1)
print("{} {}".format(ans,ans+red))
# Judge status: Wrong Answer
n = int(input())
a = input().split()

print(' '.join(a[-1:0:-2]+a[::2]))
# Judge status: Accepted
X,Y,Z=map(int,input().split())
L=X-Z
ans=0
for i in range(1000000):
    if L >= (Z+Y)*i:
        ans=i
    else:
        break
print(ans)
# Judge status: Accepted
n=int(input())
data=[]
for i in range(n):
    data.append(int(input()))
ans=0
index=1
for i in range(n):
    ans += 1
    index=data[index-1]
    if index == 2:
        print(ans)
        break
else:
    print(-1)
# Judge status: Accepted
K,X = map(int,input().split())
if 500*K >= X:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n, a, b = map(int, input().split())
answer = 0
for i in range(1, n + 1):
  if a<= sum(list(map(int, list(str(n))))) <= b:
    answer += i
print(answer)
# Judge status: Wrong Answer
h, n = map(int, input().split())
inf = 10**12
data = []
max_a = 0
for i in range(n):
    data.append(list(map(int, input().split())))
    max_a = max(max_a, data[i][0])
dp = [[inf for i in range(h+1 + max_a)] for j in range(n+1)]
dp[0][0] = 0
for i in range(n):
    a, b = data[i]
    for j in range(h):
        if j - a >= 0:
            dp[i+1][j] = min(dp[i+1][j-a] + b, dp[i][j])
        else:
            dp[i+1][j] = b
print(dp[-1][h-1])
# Judge status: Wrong Answer
import math
l=[]
l2=[]

l=list(map(str,input().split()))
d=int("".join(l))
for i in range(1,350):
 c=pow(i,2)
 l2.append(c)

if d in l2:
 print("Yes")
else :
 print("No")
# Judge status: Accepted
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 19 22:37:09 2019

@author: lucifer
"""
n=int(input())
if n%500==0:
  print(1000*int(n/500))
else:
  s=int(n/500)
  x=1000*s+int((n-(s*500))/5)*5
  print(x)
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
c4=0
c2=0
for i in range(n):
  if a[i]%4==0:
    c4+=1
  elif a[i]%2==0:
    c2+=1
    
if c2==0:
  print("Yes" if 2*c4+1>=n else "No")
else:
  x=c4*2+c2
  if x>=n:
    print("Yes")
  else:
    print("No")
# Judge status: Wrong Answer
n=int()
c=int()
for i in range(0,n):
  while n==1:
    c+=1
    print(c)
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

X = int(input())
fac = {}
fac[0] = 0
for i in range(1, 50000):
    fac[i] = fac[i-1]+i
    if fac[i]>=10**9:
        break

for i in range(1, 50000):
    f = fac[i]
    if f==X:
        print(i)
        break
    if f>X:
        print((X-fac[i-1])+i-1)
        break
# Judge status: Accepted
n=int(input())
ans=[]
ans.append(n)
tf=True
while tf:
    if n%2==0:
        n//=2
        ans.append(n)
    else:
        n=3*n+1
        ans.append(n)
    for i in range(len(ans)-1):
        for j in range(i+1,len(ans)):
            if ans[i]==ans[j]:
                print(len(ans))
                tf=False
# Judge status: Wrong Answer
S = input()
M = len(S)
N = set(S)
O = list(N)
P = len(O)
if M == P:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
a = [int(input()) for _ in range(N)]
a.insert(0, 0)
next = 1
ans = 0
for i in range(N):
    next = a[next]
    ans += 1
    if next == 2:
        print(ans)
        break
else:
    print(-1)
# Judge status: Accepted
import math
x = int(input())

ans = (x//11) * 2

x %= 11

if x == 0:
    print(ans)
elif x <= 6:
    print(ans+1)
else:
    print(ans+2)
# Judge status: Accepted
a,b = map(int,input().split())

ans = (a+b)//2 
if (a+b)%2 != 0: ans += 1
print(ans)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
dmax = [0]*(n+2)
x = []*(n+1)

i = n
ne = 0
while i >= 0:
    dmax[i] = a[i] + dmax[i+1]
    i -= 1

hantei = True
ans = 0
x.append(1)

for i in range(n+1):
    if x[i] < a[i]:
        hantei = False
        break
    else:
        x.append(min((x[i]-a[i]) * 2,dmax[i+1]))
        ans += x[i]

print(ans) if hantei else print(-1)
# Judge status: Accepted
# -*- coding: utf-8 -*-

ab, bc, ca = map(int, input().split())

print(int((ab * bc) / 2))
# Judge status: Accepted
import itertools

N = int(input())
P_list = list(map(int, input().split()))
Q_list = list(map(int, input().split()))


for i, v in enumerate(itertools.permutations(range(1,N+1))):
    if list(v) == P_list:
        a = i + 1
    if list(v) == Q_list:
        b = i + 1

print(abs(a-b))
# Judge status: Wrong Answer
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n = int(input())
    A = list(map(int, input().split()))

    cnt_4 = 0
    cnt_2 = 0
    for a in A:
        if a % 4 == 0:
            cnt_4 += 1
        elif a % 2 == 0:
            cnt_2 += 1

    print("Yes" if n - cnt_2 // 2 <= cnt_4 * 2 + 1 else "No")


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
dic = {i:0 for i in range(1, N+1)}
for i in range(N-1):
  dic[A[i]] += 1

for v in dic.values():
  print(v)
# Judge status: Wrong Answer
n,k = map(int,input().split())
if k == 0:
  print(n)
  exit()
dislike = list(map(int,input().split()))
usable = []
for i in range(10):
  if i not in dislike:
    usable.append(i)
print(usable)
ans = ''
for i in str(n):
  while int(i) not in usable:
    i = str((int(i)+1)%10)
  ans+=i
  
    
print(ans)
# Judge status: Accepted
N=int(input())

A=[int(i) for i in input().split(" ")]
if len(set(A))==N:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
S = input()
t = 0
z = 0
for i in range(0,len(S)):
  if(t == 0)and(S[i] == 'A'):
    a = i
    t += 1
  if(S[i] == 'Z') and i > z:
    z = i
print(z-a+1)
# Judge status: Wrong Answer
import math
A,B,H,M = map(int, input().split())
time = H * 60 + M

Asita = time / 720
Bsita = (time % 60) / 60
sita = abs(Asita - Bsita) * 2 * math.pi

Ans = ( A**2 + B**2 - 2 * A * B * abs(math.cos(sita)))**0.5
print(Ans)
# Judge status: Accepted
A, B, C = map(int, input().split())
K = int(input())

ans = "No"
def f(a, b, c, cnt, k):
    global ans
    if cnt > k:
        return
    if b > a and c > b:
        ans = "Yes"
        return
    
    f(2*a, b, c, cnt+1, k)
    f(a, 2*b, c, cnt+1, k)
    f(a, b, 2*c, cnt+1, k)


f(A, B, C, 0, K)
print(ans)
# Judge status: Accepted
x=int(input())
l=x//11
cnt=2*l
if x%11==0:
  print(cnt)
elif 0<x%11<=6:
  print(cnt+1)
else:
  print(cnt+2)
# Judge status: Wrong Answer
def o(a):
    for i in range(len(a)):
        a[i]=[a[i],i+1]
    return a             

n = int(input())
a = list(map(int, input().split()))
a=o(a)
q=[0]*n
for i in range(len(a)):
    q[a[i][0]-1]=a[i][1]
print(q)
# Judge status: Wrong Answer
from collections import Counter
N, M = map(int, input().split())
dis_list = []
my_count = Counter()
for i in range(M):
    a, b = list(map(int, input().split()))
    my_count[a] += 1
    my_count[b] += 1
for i in my_count.values():
    print(i)
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))
tmp = 0
ans = 0
for i in range(N-1):
  if H[i] >= H[i+1]:
    tmp += 1
    ans = max(tmp, ans)
  else:
    tmp = 0
print(ans)
# Judge status: Accepted
ma = lambda :map(int,input().split())
lma = lambda :list(map(int,input().split()))
tma = lambda :tuple(map(int,input().split()))
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
ips = lambda:input().split()
import collections
import math
import itertools
import heapq as hq
n = ni()
ans = 0
for a in range(1,n):
    ans += (n-1)//a
print(ans)
# Judge status: Accepted
N, M = map(int, input().split())


def make_divisors(n):
    lower_divisors, upper_divisors = [], []
    i = 1
    while i * i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n // i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

div_list = make_divisors(M)
div_list = div_list[::-1]
for div in div_list:
    if N * div <= M:
        print(div)
        exit()
# Judge status: Wrong Answer
n = int(input())
import bisect
a = sorted(list(map(int, input().split(" "))))
ans = 0
for i in range(1, n-1):
  b = a[:i]
  c = a[i + 1:]
  #print(b, c)
  for j in b:
    ans += bisect.bisect(c, a[i]+j-0.1) - bisect.bisect(c, a[i]+0.1)
    #print(bisect.bisect(c, a[i]+j-0.1), bisect.bisect(c, a[i]+0.1))
print(ans)
# Judge status: Accepted
n = int(input())
al = list(map(int, input().split()))

min_abs = 10**9
abs_sum = 0
minus_cnt = 0
zero_cnt = 0
for a in al:
    if a < 0: minus_cnt+=1
    elif a == 0: zero_cnt+=1
    abs_sum += abs(a)
    min_abs = min(min_abs, abs(a))

if minus_cnt%2 == 0:
    print(abs_sum)
else:
    if zero_cnt > 0:
        print(abs_sum)
    else:
        print(abs_sum-min_abs*2)
# Judge status: Wrong Answer
n500 = int(input())
n100 = int(input())
n50 = int(input())
p = int(input())
ans = 0

for i in range(n500):
    temp = 0
    temp = i*500
    for j in range(n100):
        temp = i*500+j*100
        for k in range(n50):
            temp = i*500+j*100+k*50 
            if temp == p:
                ans+=1

print(ans)
# Judge status: Accepted
a=input()
l=[chr(i) for i in range(97,97+26)]
if a in l:
  print('a')
else:
  print('A')
# Judge status: Accepted
#E
n = int(input())
a = list(map(int,input().split()))
result = []
A = 0
for i in range(len(a)):
    A = A^a[i]
    
for i in range(len(a)):
    result.append(a[i]^A)
    
print(*result)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))

cnt_0, cnt_2, cnt_4 = 0, 0, 0
for i in range(N):
  if A[i] % 4 == 0:
    cnt_4 += 1
  elif A[i] % 2 == 0:
    cnt_2 += 1
  else:
    cnt_0 += 1

if cnt_2 == 0:
  if cnt_4 >= cnt_0 - 1:
    print("Yes")
  else:
    print("No")
else:
  if cnt_4 >= cnt_0:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
N = int(input())
items = set()
for n in range(0, N):
  items.add(input())
print(len(items))
# Judge status: Accepted
from collections import defaultdict, deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
from fractions import gcd
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7
EPS = 10**-7


n, k = map(int, input().split())
s = input()

s = list(s)
s[k-1] = s[k-1].lower()
ans_s = ""
for i in s:
    ans_s += i
print(ans_s)
# Judge status: Wrong Answer
a,b,c= map(int, input().split())
if a<c<b:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import math

a, b = map(int, input().split())
print(math.ceil((a + b) / 2))
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

X = int(input())
double = X*2+1
s = set()
for i in range(2, double):
    if i in s:
        continue
    if i>X:
        print(i)
        break
    cnt = 1
    while cnt*i<=double:
        s.add(i*cnt)
        cnt += 1
# Judge status: Accepted
x, y  = map(int, input().split())
if(y & 1):
  print("No")
elif(y < (x<<1) or y > (x<<2)):
  print("No")
else:
  print("Yes")
# Judge status: Accepted
N,K=map(int, input().split())
D=list(map(int, input().split()))

for i in range(N,10**9):
    S=str(i)
    ok=True
    for s in S:
        if int(s) in D:
            ok=False
    if ok:
        ans=i
        break

print(ans)
# Judge status: Accepted
a, b, c = map(int, input().split())
print("Yes" if b >= c >= a else "No")
# Judge status: Wrong Answer
N,A,B = map(int,input().split())
S = list(input())

C = A + B
ans = []
df = 0
f = 0

for i in range(N):
  s = S[i]
  if s == 'c':
    ans.append('No')
    continue
  elif s == 'a':
    df += 1
    if df <= C:
      ans.append('Yes')
    else:
      ans.append('No')
  elif s == 'b':
    df += 1
    f += 1
    if df <= C and f <= B:
      ans.append('Yes')
    else:
      ans.append('No')
      
print('\n'.join(ans))
# Judge status: Wrong Answer
N = int(input())
S = list(input())

m = 0

l = [max(m, len(set(S[:S.index(s)])&(set(S[S.index(s):])))) for s in S]
print(max(l))
# Judge status: Accepted
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()

ans = 0
for i in range(1, N+1):
	m = N//i
	ans += m*(m+1)*i//2
print(int(ans))
# Judge status: Accepted
a, b, c, x, y = map(int, input().split())

ans = 0

if c*2 < a+b:
    ans += min(x, y) * c * 2
    if x > y:
        ans += min(a, 2*c) * abs(x-y)
    elif x < y:
        ans += min(b, 2*c) * abs(x-y)
else:
    ans += a * x + b * y

print(ans)
# Judge status: Wrong Answer
import math
x, y = map(int, input().split())

ans = int(math.log2(y/x))

print(ans + 1)
# Judge status: Wrong Answer
def resolve():
    n = int(input())
    L = map(int, input().split())
    M = max(L)
    R = sum(L) - M
    if R > M:
        print('Yes')
    else:
        print('No')
resolve()
# Judge status: Accepted
def main():
    N, K = (int(i) for i in input().split())
    H = [int(input()) for i in range(N)]
    ans = 10**12
    H.sort()
    for i in range(N-K+1):
        ans = min(ans, H[i+K-1] - H[i])
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n,x,y = map(int,input().split())

u = []
for i in range(1,n):
    for j in range(i+1,n+1):
        u.append(min(j-i,abs(x-i)+abs(y-j)+1))

import collections
u2 = collections.Counter(u)
u2 = list(u2.items())
for k in range(n):
    u2.append((0,0))

for i in range(n-1):
    if u2[i][0] == i+1:
        print(u2[i][1])
    else:
        print(0)
# Judge status: Accepted
a,b,x = map(int,input().split())
print('YES' if 0<=x-a<=b else 'NO')
# Judge status: Wrong Answer
n,k = map(int,input().split())
a = list(map(int,input().split()))

leq,high = 0,1e10
while high-leq > 1:
  l = int((leq+high)/2)
  cnt = 0
  for ai in a:
    cnt += int((ai-1)/l)
  print(l,cnt)
  if cnt>k:
    leq = l
  else:
    high = l

print(high)
# Judge status: Accepted
import sys
import math as mt
input=sys.stdin.buffer.readline  
#t=int(input())
t=1
for __ in range(t):
    #n,k=map(int,input().split())
    n=int(input())
    l=list(map(int,input().split()))
    xori=0
    for i in l:
        xori^=i
    for i in l:
        print(xori^i,end=" ")
# Judge status: Wrong Answer
A, B, M = map(int, input().split())
a = list(map(int, input().split())) 
b = list(map(int, input().split())) 

x = [0] * M
y = [0] * M
c = [0] * M

ans = 10 ** 5
for i in range(M):
    x[i], y[i], c[i] = map(int, input().split())
    p = a[x[i]-1] + b[y[i]-1] - c[i]
    if ans > p:
        ans = p
    
if ans > min(a) + min(b):
    ans = min(a) + min(b)
elif ans > min(a):
    ans = min(a)
else:
    ans = min(b)

print(ans)
# Judge status: Accepted
x,k,d= map(int, input().split())

if x-k*d>=0 :
  print(str(x-k*d))
elif x+k*d<=0 :
  print(abs(x+k*d))
else :
  a=x//d
  b=x%d
  if (k-a)%2==0 :
    print(str(b))
  else :
    print(str(d-b))
# Judge status: Wrong Answer
a, b = map(int, input().split())
print((a + b + 1)/ 2)
# Judge status: Accepted
n = int(input())
inp = []
for i in range(n-1):
    inp.append(list(map(int, input().split())))

for i in range(n-1):
    total = 0
    for j in range(i, n-1):
        if total < inp[j][1]:
            total = inp[j][1]
        while total % inp[j][2] != 0:
            total += 1
        total += inp[j][0]
    print(total)
print(0)
# Judge status: Accepted
h,w = map(int, input().split())
if h == 1 or w == 1:
  print(1)
elif h % 2 == 0 or w % 2 == 0:
  print(h*w//2)
else:
  print((h*w + 1)//2)
# Judge status: Wrong Answer
N = int(input())
ans = "No"
for i in range(1,9):
    if N%i == 0:
        ans = "Yes"
print(ans)