peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))

f = 0
i = 0
ans = 1
for i in range(n-1):
  if f==0 and A[i+1]-A[i] > 0:
    f = 1
  elif f==0 and A[i+1]-A[i] < 0:
    f = -1
  elif (f < 0 and A[i+1]-A[i] > 0) or (f > 0 and A[i+1]-A[i] < 0):
    f = 0
    ans += 1
    
print(ans)
# Judge status: Accepted
from collections import deque
a = deque(reversed(input()))
b = deque(reversed(input()))
c = deque(reversed(input()))
ne = a.pop()
while(True):
    if ne == 'a':
        if not a: break
        ne = a.pop()
    elif ne == 'b':
        if not b: break
        ne = b.pop()
    else:
        if not c: break
        ne = c.pop()
print(ne.upper())
# Judge status: Accepted
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

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

tmp = n//k

a = abs(n-k*tmp)
b = abs(a-k)

print(min(a,b))
# Judge status: Accepted
S=input()
L=list(S)
if len(L)==len(set(L)):
  print('yes')
else:
  print('no')
# Judge status: Accepted
S = input()
zero = 0
for s in S:
  if s=='0':
    zero+=1
one = len(S)-zero
print(min(one,zero)*2)
# Judge status: Accepted
a, b, c = map(int, input().split())
K = int(input())
m = max(a, b, c)
print(a + b + c - m + m * 2 ** K)
# Judge status: Wrong Answer
n,x = map(int,input().split())
a = sorted(map(int,input().split()))
c=0
for i in a:
    if i<=x:
        x-=i
        c+=1
else:
    if x>0:
        c-=1
print(max(0,c))
# Judge status: Wrong Answer
import re
print("WA" if re.match('A[a-z][a-z][a-z]*C[a-z]*[a-z]',input()) == None else "AC")
# Judge status: Accepted
import math
import sys

stdin = sys.stdin

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(stdin.readline().rstrip())
nm = lambda: map(int, stdin.readline().split())
nl = lambda: list(map(int, stdin.readline().split()))
mod = 10**9 + 7 
sys.setrecursionlimit(1000010)


A,B,H,M = nm()
(a, b, h, m)=map(float,(A,B,H,M))

theta = 2.0 * math.pi * ( m /60.0 - (h + m /60.0 )/12.0)
print(math.sqrt( a * a + b * b - 2.0 * a * b * math.cos(theta)))
# Judge status: Accepted
n,x = map(int,input().split())
L = list(map(int,input().split()))

s = 0
for i in range(n):
    s += L[i]
    if s > x:
        print(i+1)
        break
else:
    print(n+1)
# Judge status: Accepted
N, K = map(int, input().split())

print(0 if N%K==0 else 1)
# Judge status: Wrong Answer
n,w=[int(i) for i in input().split()]
wi=[]
val=[]
for i in range(n):
    k=[int(i) for i in input().split()]
    wi.append(k[0])
    val.append(k[1])
dp=[[-1]*10**5]*105
print(wi,val)
def solve(pos,we):
    if we>w:
        return float("-inf")
    if pos>=n:
        return 0
    if dp[pos][we]!=-1:
        return dp[pos][we]
    ans=max(solve(pos+1,we+wi[pos])+val[pos],solve(pos+1,we))
    dp[pos][we]=ans
    return ans
print(solve(0,0))
# Judge status: Wrong Answer
a, b, c, k = map(int, input().split())
sum = 0
if k > a:
    sum = a
    if k-a <= b:
        sum = a
    else:
        sum = 2*a+b-k
print(sum)
# Judge status: Wrong Answer
l = [[1,3,5,7,8,10,12], [4,6,9,11], [2]]
a, b = map(int, input().split())

for i in l:
  if a in i and b in i:
    print('Yes')
    break
  else:
    print('No')
    break
# Judge status: Wrong Answer
y, m, d = map(int, input().split("/"))
if y * 365 + m * 12 + d > 2019 * 365 + 4 * 12 + 30:
  print("TBD")
else:
  print("Heisei")
# Judge status: Accepted
n = int(input())
l = [0] * (n+1)
l[0] = 2
l[1] = 1

if n == 1:
    ans = l[1]
else:
    for i in range(2, n+1):
        l[i] = l[i-1] + l[i-2]
    ans = l[-1]
print(ans)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    S = list(input())

    isWA = False
    if S[0] != 'A':
        isWA = True

    if S[2:-1].count('C') != 1:
        isWA = True

    for s in S:
        if s == 'A' or s == 'C':
            continue
        if s.isupper():
            isWA = True

    if isWA:
        print('WA')
    else:
        print('AC')
    

if __name__ == '__main__':
    main()
# Judge status: Accepted
n,l=map(int,input().split())
ringo=[i+l-1 for i in range(1,n+1)]
ringo.sort(key=lambda x:abs(x))
print(sum(ringo[1:]))
# Judge status: Accepted
s = input()
n = len(s)
interval = n - 7
flag = False
start = 0
end = interval
for i in range(n-interval):
    news = s[0:start] + s[end:]
    if news == 'keyence':
        print('YES')
        flag = True
        break
    start+=1
    end+=1
if not flag:
    print('NO')
# Judge status: Accepted
import bisect
N = int(input())
D = [0]*12
SD = [0]*12
tmp = 26
for i in range(1, 12):
    D[i] = tmp
    SD[i] = SD[i-1] + D[i]
    if SD[i] > 1000000000000001:
        break
    tmp *= 26


L = bisect.bisect_left(SD, N)
alpha = 'abcdefghijklmnopqrstuvwxyz'
ans = []
N -= SD[L-1] + 1
for i in range(L):
    ans.append(alpha[N % 26])
    N //= 26


print("".join(ans[::-1]))
# Judge status: Wrong Answer
from math import sqrt

A, B = map(int, input().split())
rootA = round(sqrt(A))
rootB = round(sqrt(B))

PrimeFactorA = []
PrimeFactorB = []
for i in range(2, rootA+1):
	while A%i == 0:
		A //= i
		PrimeFactorA.append(i)
PrimeFactorA = set(PrimeFactorA)

for i in range(2, rootB+1):
	while B%i == 0:
		B //= i
		PrimeFactorB.append(i)
PrimeFactorB = set(PrimeFactorB)

count = 1
if PrimeFactorA and PrimeFactorB:
	for a in PrimeFactorA:
		if a in PrimeFactorB:
			count += 1

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


if n % 2:
    x = n - 2
    y = n - x

    resulty, resultx = 0, 0
    while(x > 0):
        resultx += x % 10
        x = x // 10

    while(y > 0):
        resulty += y % 10
        y = y // 10
    print(resulty+resultx)
else:
    x = n//2
    
    result = 0
    while(x > 0):
        result += x % 10
        x = x // 10
    print(result*2)
# Judge status: Accepted
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))


# 地点の平均気温を計算しListHに格納
for i in range(N):
    H[i] = T - (abs(H[i]) * 0.006)

# 目的の平均気温との差をListHに格納
for k in range(N):
    H[k] = abs(H[k] - (A))

# 差が最も小さいもののリスト番号に1を足して出力
print((H.index(min(H)))+1)
# Judge status: Accepted
#126 a
n,k=map(int,input().split())
s=input()
ans=""
for i in range(n):
    if i==(k-1):
        ans+=s[i].lower()
    else:
        ans+=s[i]
print(ans)
# Judge status: Wrong Answer
N = int(input())
X = [float(x) for x in input().split()]

P = round(sum(X)/N)
print(sum([(x-P)**2 for x in X]))
# Judge status: Wrong Answer
d,n = map(int,input().split())
print(n*(100**d))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    X = int(input())
    if X in (3, 5, 7):
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()
# Judge status: Accepted
#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    N, K = map(int, input().split())
    S = list(input())
    S[K - 1] = S[K - 1].lower()
    print(*S, sep='')


if __name__ == "__main__":
    main()
# Judge status: Accepted
a,b,t=[int(x) for x in input().split()]

ans=(t//a)*b

print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
n1=min(N,M//2)
print(n1+(M-2*n1)//4)
# Judge status: Accepted
n, m = map(int, input().split())
broken = [0]*(n+1)
for i in range(m):
    a = int(input())
    broken[a] = 1
dp = [0]*(n+1)
dp[0] = 1
mod = 1000000007
for i in range(1, n+1):
    if broken[i]:
        continue
    dp[i] = (dp[i-1] + dp[i-2]) % mod
print(dp[n])
# Judge status: Accepted
s = input()
for i in range(1, len(s)):
    if (len(s) - i) % 2 == 0 and s[0:(len(s)-i)//2] == s[(len(s)-i)//2:-i]:
        print(len(s)-i)
        exit()
# Judge status: Accepted
n = int(input())
X = list(map(int, input().split()))
X_sort = sorted(X)
xm1 = X_sort[n//2-1]
xm2 = X_sort[n//2]
xm = (xm1+xm2)/2
for i in range(n):
    if X[i]<xm:
        print(xm2)
    else:
        print(xm1)
# Judge status: Wrong Answer
n,h=map(int,input().split())
ab=[list(map(int,input().split()))for _ in range(n)]
c=max([a[0] for a in ab])
d=[b[1] for b in ab if b[1]>c]
d.sort(reverse=True)
ans=0
while len(d)>0:
    h-=d.pop()
    ans+=1
    if h<=0:
        print(ans)
        exit()
f=(h+c-1)//c
print(ans+f)
# Judge status: Wrong Answer
a=input()
b=a
c=b[::-1]
d=0
for i in range(len(a)):
  if a[i]!=c[i]:
    d+=1
  else:
    pass
print(d)
# Judge status: Accepted
import itertools


n = int(input())

XY = {xy:0 for xy in itertools.product("0123456789", repeat = 2)}
for i in range(1, n + 1):
    x, y = str(i)[0], str(i)[-1]
    XY[(x, y)] += 1

answer = 0
for a in range(1, n + 1):
    x, y = str(a)[0], str(a)[-1]
    answer += XY[(y, x)]

print(answer)
# Judge status: Accepted
n = int(input())
a, b = [0] * n, [0] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())

ans = 0
for i in range(n - 1, -1, -1):
    ans += (b[i] - (a[i] + ans) % b[i]) % b[i]

print(ans)
# Judge status: Wrong Answer
s = [input() for i in range(2)]
S = s[0]
T = s[1]
print(S)
print(T)


def count_diff2(s, t):
    cnt = 0
    for c1,c2 in zip(s, t):
        if c1 != c2:
            cnt += 1
    return cnt

print(count_diff2(S, T))
# Judge status: Accepted
a = int(input())
if a == 3 or a == 5 or a == 7:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
a,b,n = map(int,input().split())
if(n<b):
    n=n
else:
    n=b-1
F = (a*n)//b
print(int(F))
# Judge status: Accepted
# A - Serval vs Monster
def main():
    H, A = map(int, input().split())
    print((H + A - 1) // A)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
#!/usr/bin/env python

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

ans = 1001001000
l = a[0]
r = sum(a)-l

for i in range(n):
    if abs(l-r) <= ans:
        ans = abs(l-r)
    if i == n-1:
        break
    l += a[i]
    r -= a[i]

print(ans)
# Judge status: Accepted
S = list(input())
N = len(S)
a = 0
b = 0
c = 0
for i in range(N):
  if S[i] == 'a':
    a += 1
  elif S[i] == 'b':
    b += 1
  else:
    c += 1
if N == 1:
  ans = 'YES'
elif N == 2:
  if max(a, b, c) == 2:
    ans = 'NO'
  else:
    ans = 'YES'
else:
  if min(a, b, c) == 0:
    ans = 'NO'
  elif max(a, b, c) - min(a, b, c) < 2:
    ans = 'YES'
  else:
    ans = 'NO'
print(ans)
# Judge status: Wrong Answer
n = input()

if n[-1:] == str(2) or  n[-1:] ==  str(4) or  n[-1:] == str(7) or  n[-1:] == str(9):
  print('hon')
if (n[-1:]) == str(0) or  n[-1:] == str(1) or  n[-1:] == str(6) or  n[-1:] == str(8):
  print('bon')
if (n[-1:]) == str(3):
  print('pon')
# Judge status: Accepted
MOD=10**9+7
N=int(input())
S=input()
cnt=[0]*26
for x in S:
    cnt[ord(x)-97]+=1
res=1
for i in range(26):
    res=res*(cnt[i]+1)%MOD
print(res-1)
# Judge status: Accepted
def i():
	return int(input())
def i2():
	return map(int,input().split())
def s():
	return str(input())
def l():
	return list(input())
def intl():
	return list(int(k) for k in input().split())

a = i()
b = i()
c = i()
x = i()

ans = 0
for i in range(a+1):
	for j in range(b+1):
		for k in range(c+1):
			if x == 500*i + 100*j + 50*k:
				ans += 1
print(ans)
# Judge status: Accepted
a,b,k = map(int,input().split())

X = []

for i in range(k):
    if a+i <= b:
        X.append(a+i)
    if a <= b-i:
        X.append(b-i)
        
X = sorted(set(X))

for i in range(len(X)):
    print(X[i])
# Judge status: Accepted
A,B,K = map(int,input().split())

if A-K >= 0:
    A -= K
elif B-(K-A)>=0:
    B -= (K-A)
    A = 0
else:
    A = 0
    B = 0

print('{} {}'.format(A,B))
# Judge status: Wrong Answer
import sys

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


def resolve():
    n = int(input())
    s = input()
    t = input()

    res = n
    for i in range(n):
        for j in range(n):
            if i + j < n:
                if s[i + j] != t[j]:
                    break
        else:
            res = i

    print(res + n)


if __name__ == '__main__':
    resolve()
# Judge status: Accepted
n = int(input())

if n == 1:
  print(0)
elif n == 0:
  print(1)
# Judge status: Accepted
def main():
    N = int(input())

    ma = 0
    tot = 0
    while tot < N:
        ma += 1
        tot += ma

    skip = tot - N
    ans = {x for x in range(1, ma + 1) if x != skip}

    print(*ans, sep='\n')


if __name__ == '__main__':
    main()
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, c, k = map(int, readline().split())
t = sorted([int(readline()) for i in range(n)])
cnt = 0
ans = 1
time = t[0] + k
for i in range(n):
    if cnt >= c or time < t[i]:
        ans += 1
        cnt = 0
        time = t[i] + k
    cnt += 1
print(ans)
# Judge status: Accepted
n = int(input())
l = len(str(n))
res = 0
for i in range(1, l + 1, 2):
    if i == l:
        res += n - 10**(l-1) + 1
    else: res += (10**(i) - 1) - (10**(i-1)) + 1
print(res)
# Judge status: Accepted
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,M=MI()
    ans=(N*(N-1))//2+(M*(M-1))//2
    print(ans)
main()
# Judge status: Accepted
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)
b = ""
ans = []
for i in range(n):
  if b == "": b = a[i]
  elif b != a[i]: b = a[i]
  elif a[i] == b:
    ans.append(a[i])
    b = ""
    if len(ans) == 2: break
print(0 if len(ans) != 2 else ans[0] * ans[1])
# Judge status: Wrong Answer
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    n,m=map(int, input().split())
    cnt=0
    if n<=2*m:
        cnt+=n
        m-=n*2
        cnt+=m//4
    else:
        cnt+=m//2
    print(cnt)
resolve()
# Judge status: Accepted
n,x=map(int,input().split())
L=[int(_) for _ in input().split()]
S_L=[0]
count=1
for i in range(n):
    S_L.append(S_L[-1]+L[i])
    if S_L[-1]<=x:
        count+=1
    else:
        print(count)
        break
else:print(n+1)
# Judge status: Wrong Answer
a,b=map(float,input().split())
print(a*b//1)
# Judge status: Accepted
n,x = map(int,input().split())
A = list(map(int,input().split()))
ans = 0
for i in range(1,n):
    if A[i] + A[i-1] > x:
        if A[i-1] > x:
            ans += A[i-1] - x
            A[i-1] = x
        ans += A[i] + A[i-1] - x
        A[i] = x - A[i-1]
print(ans)
# Judge status: Accepted
x = int(input())
ans = (x//11)*2
ans += x%11>6
ans += x%11 > 0
print(ans)
# Judge status: Wrong Answer
n = int(input())
p = 1
for i in range(n):
	p *= i
print(i % 10**9+7)
# Judge status: Wrong Answer
s = str(input())
s = s[:-1]
count = 0
while len(s)>1 and (s[0] != s[-1] or s[0] == s[-1]):
    if s[0] != s[-1]:
        s = s[:-1]
    elif s[0] == s[-1]:
        s = s[1:-1]
        count += 2
    
print(count)
# Judge status: Wrong Answer
n,m=map(int,input().split())
l1,r2=1,n
if m%2:
  r1=m
else:
  r1=m+1
l2=r1+1
for i in range(m//2):
  print(l1,r1)
  print(l2,r2)
  l1+=1
  l2+=1
  r1-=1
  r2-=1
if m%2:
  print(l2,r2)
# Judge status: Accepted
S = input()
ans = "NO"
for i in range(len(S)):
  for j in range(len(S)):
    if S[0:i] + S[i+j:len(S)] == "keyence":
      print("YES")
      exit()
print(ans)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if e - a > k:
  print(":(")
else:
  print("Yay!")
# Judge status: Wrong Answer
N,M=map(int,input().split())
MOD=10**9+7
if N>=M:
  s=1
  for i in range(2,N+1):
    s=s*i
  t=N-M+2
  for j in range(N-M+3,N+1):
    t=t*j
  print((s*t)%MOD)
else:
  s=1
  for i in range(2,M+1):
    s=s*i
  t=M-N+2
  for j in range(N-M+3,N+1):
    t=t*j
  print((s*t)%MOD)
# Judge status: Accepted
import math

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

zero_count = 0
one_count = 0

for num in a:
    if num % 2 == 0:
        zero_count += 1
    else:
        one_count += 1

coef = 2 ** zero_count

ans = 0

for i in range(one_count + 1):
    if i % 2 != p:
        continue
        
    ans += math.factorial(one_count) // math.factorial(one_count - i) // math.factorial(i)
print(ans * coef)
# Judge status: Wrong Answer
s = int(input())
print(1000 - s % 1000)
# Judge status: Accepted
N, K = map(int, input().split())
*A, = map(int, input().split())
for k in range(41):
    B = [0] * N
    for i, a in enumerate(A):
        l = max(0, i - a)
        r = min(N - 1, i + a)
        B[l] += 1
        if r + 1 < N: B[r + 1] -= 1
    for i in range(1, N): B[i] += B[i-1]
    A = B
    if k == K - 1: break
print(*A)
# Judge status: Accepted
from collections import deque

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

graph = [[] for _ in range(n)]
for _ in range(m):
  a, b = map(int, input().split())
  graph[a - 1].append(b - 1)
  graph[b - 1].append(a - 1)

ans = [-1] * (n - 1)

q = deque()
q.append(0)
used = {0}
while q:
  node = q.popleft()
  for next_node in graph[node]:
    if next_node in used:
      continue
    q.append(next_node)
    used.add(next_node)
    ans[next_node - 1] = node + 1

print('Yes')
print(*ans, sep='\n')
# Judge status: Accepted
N = int(input())
T,X,Y =0,0,0
count = 0
for i in range(N):
    t,x,y = map(int,input().split())
    if abs(t-T) >= abs((x+y)-(X+Y)) and t%2==(x+y)%2:
        count+=1
T,X,Y=t,x,y
print('Yes' if count==N else 'No' )
# Judge status: Wrong Answer
n = int(input())

ans = ''

while n != 0:
    r = n % 2 
    print(r)

    if r < 0:
        r = r + 2
    
    n = (n-r) / (-2)

    ans = ans + str(int(r))

ans = list(ans)    
print(ans)
ans.reverse()
print(''.join(ans))
# Judge status: Accepted
n = int(input())
A = [*map(int, input().split())]
MOD = 10**9 + 7
ans = b = 0
for a in A:
    ans += a * b
    ans %= MOD
    b += a
print(ans)
# Judge status: Wrong Answer
N = int(input())
num_list = list(map(int,input().split()))
q = int(input())

num_list.sort()

for i in range(q):
  query = list(map(int,input().split()))
  for j in range(len(num_list)):
    if num_list[j] == query[0]:
      num_list[j] = query[1]
    if num_list[j] > query[0]:
      break
  print(sum(num_list))
# Judge status: Wrong Answer
N, M = map(int, input().split())
print(N * (N-1) / 2 + M * (M-1) / 2)
# Judge status: Wrong Answer
def main():
    x = int(input())

    for i in range(x):
        if 0 <= x - 100 * i < 5 * i:
            print(1)
            exit()
    else:
        print(0)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n = int(input())
now = [0, 0, 0]
def ng():
  print('No')
  exit()
for i in range(n):
  t, x, y = map(int, input().split())
  if t % 2 != (x + y) % 2:
    ng()
  if abs(x - now[1]) + abs(y - now[2]) > t - now[0]:
    ng()
print('Yes')
# Judge status: Accepted
n = int(input())
a = int(input())

if n%500 <= a:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
S = list(input())

s = set(S)

if len(s) == len(S):
    print("yes")
else:
    print("no")
# Judge status: Accepted
s = input()

for i in range(len(s)):
    if s[i] == 'A':
        break

for j in range(len(s)-1,-1,-1):
    if s[j] == 'Z':
        break

print(len(s[i:j+1]))
# Judge status: Wrong Answer
import collections
import sys
a=input()
b=[]

for i in a:
  b.append(i)
  
b.sort()
c=collections.Counter(b)
c=list(c.values())

for i in range(len(c)):
  if int(c[i])%2==0:
    q=0
  else:
    q=1
    print('No')
    sys.exit()
    
print('Yes')
# Judge status: Accepted
A = input()

if A.isupper() == True:
    print("A")
else:
    print("a")
# Judge status: Accepted
n_l = list(map(str, input().split()))

n_l.sort(reverse=True)

print(int(n_l[0] + n_l[1]) + int(n_l[-1]))
# Judge status: Accepted
n,k= list(map(int, input().split()))
from math import factorial
if n>1:
    a=factorial(n)//factorial(2)//factorial(n-2)
else:
    a=0
if k>1:
    b=factorial(k)//factorial(2)//factorial(k-2)
else:
    b=0
print(a+b)
# Judge status: Wrong Answer
N,X = map(int,input().split())
W = list(map(int,input().split())) + [X]
W = sorted(W)
dist = 10**18
print(W)
if len(W) == 2:
  print(W[1]-W[0])
  exit()
for i in range(1,N+1):
  dist = min(dist, W[i]-W[i-1])
  while (W[i]-W[i-1])%dist != 0:
    dist //= 2
  if dist == 1:
    break
print(dist)
# Judge status: Accepted
import math

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

if 4*n*m < (k-n-m)*(k-n-m) and k>n+m:
    print('Yes')
else:
    print("No")
# Judge status: Wrong Answer
print('win' if sum(map(int, input().split())) < 21 else 'bust')
# Judge status: Accepted
s,t=input().split()
print(t+s)
# Judge status: Accepted
import sys


def main():
    input = sys.stdin.buffer.readline
    x = int(input())
    a, b = divmod(x, 500)
    c = b // 5
    print(1000 * a + 5 * c)


if __name__ == "__main__":
    main()
# Judge status: Accepted
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda k: -k[1])

stack = []
cnt = 0
for b, c in BC:
  for _ in range(b):
    stack.append(c)
    cnt += 1
    if cnt > n:
      break

for i in range(min(n, len(stack))):
  if A[i] < stack[i]:
    A[i] = stack[i]
  else:
    break
    
print(sum(A))
# Judge status: Accepted
l,r,d = map(int, input().split())
cnt = 0
for i in range(l,r+1):
    if i%d==0: cnt += 1
print(cnt)
# Judge status: Accepted
n, l = map(int, input().split())
x = 100
y = 100
for i in range(n):
    if abs(l+i) < x:
        x = abs(l+i)
        y = l+i
print(l*n+sum(range(1, n+1))-n-y)
# Judge status: Accepted
from numpy import *
N,K = map(int,input().split())
A = log(array(list(map(int,input().split()))))
B = [sum(A[:K])]

for n in range(N-K):
  B+=[B[-1]+A[n+K]-A[n]]
  
  if B[n]<B[n+1]:
    print("Yes")
  else:
    print("No")
# Judge status: Accepted
d,n = map(int,input().split())
if n == 100:
    print(101 * 100**d)
else:
    print(n * 100**d)
# Judge status: Accepted
import math

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

if B - 1 <= N:
    x = B - 1
else:
    x = N

ans = math.floor(A * x / B) - A * math.floor(x / B)
print(ans)
# Judge status: Wrong Answer
#coding:utf-8

N = int(input())

ron = 10 ** 9 + 7

a = (10 ** N) % ron

b = (9 ** N) % ron

c = (9 ** N) % ron 

bandc = (8 ** N) % ron

ans = a - b - c + bandc

print("{}".format(ans))
# Judge status: Accepted
n=int(input())
x=[int(x) for x in input().split()]
x1=sorted(x)

left=x1[n//2-1]
right=x1[n//2]

for i in x:
  if i<=left:
    print(right)
  else:
    print(left)
# Judge status: Accepted
x,y=map(int,input().split())
res=0
while x<=y:
    res+=1
    x*=2
print(res)
# Judge status: Wrong Answer
N = int(input())

L =[]
while N > 1:
  amari = N % 26
  L.append(amari)
  N = N // 26

ans = ''
trans =['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']
for i in range(len(L)):
  ans += trans[L[i]-1]

rans = ''
for i in range(len(ans)-1,-1,-1):
  rans += ans[i]
  
print(rans)
# Judge status: Accepted
a,b,c,x,y=map(int,input().split())
if x<y:
  x,y=y,x
  a,b=b,a
print(min(a*x+b*y,2*c*y+a*(x-y),2*c*x))
# Judge status: Accepted
N = int(input())
X = [int(T) for T in input().split()]
SortX = sorted(X)
MedL = SortX[(N//2)-1]
MedR = SortX[(N//2)]
Disp = [0]*N
for T in range(0,N):
    if X[T]<=MedL:
        Disp[T] = str(MedR)
    else:
        Disp[T] = str(MedL)
print('\n'.join(Disp))
# Judge status: Accepted
from collections import deque
N, M = map(int, input().split())
G = [[] for _ in range(N+1)]

for i in range(M):
    x, y = map(int, input().split())
    G[x].append(y)
    G[y].append(x)

USED = [-1] * (N+1)
USED[0] = 0
USED[1] = 0

Q = deque()
Q.append(1)

while Q:
    x = Q.pop()
    for t in G[x]:
        if USED[t] == -1:
            Q.appendleft(t)
            USED[t] = x

if -1 in USED:
    print("No")
else:
    print("Yes")
    print(*USED[2:])
# Judge status: Accepted
A = list(map(int, input().split()))
N = int(input())

a = min(A[0]*4, A[1]*2, A[2])
b = A[3]

ans = min(N * a, N//2*b + (N%2)*a)
print(ans)
# Judge status: Accepted
def main():
    N = int(input())
    A = [int(i) for i in input().split()]
    from collections import Counter
    c = Counter(A)
    ans = 0
    for k in c.keys():
        cur = c[k-1] + c[k] + c[k+1]
        ans = max(cur, ans)
    print(ans)


if __name__ == '__main__':
    main()