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

D.sort()
m = int(len(D)/2)
print(D[m] - D[m - 1])
# Judge status: Accepted
n, k = map(int,input().split())
x = list(map(int,input().split()))

ret = 10**20

for i in range(n-k+1):
	left = x[i]
	right = x[i+k-1]
	ret = min(ret, min(abs(left), abs(right)) + right - left )

print(ret)
# Judge status: Accepted
# A - The Number of Even Pairs
N,M = list(map(int, input().split()))
ans = int(N*(N-1)/2 + M*(M-1)/2)
print(ans)
# Judge status: Accepted
n = int(input())
A = [i for i in map(int,input().split())]
A_set = set(A)
if len(A) == len(A_set):
  print("YES")
else:
  print("NO")
# Judge status: Accepted
x,k,d  = map(int,input().split())

passSinaiCount = abs(x)//d

if passSinaiCount >= k:
    print(abs(x) - k*d)
    exit()

passSinaiDistance = abs(x) - passSinaiCount * d
passSuruDistance = d - passSinaiDistance

nokoriCount = k - passSinaiCount
if nokoriCount % 2 == 0:
    print(passSinaiDistance)
else:
    print(passSuruDistance)
# Judge status: Accepted
S = input()
T = input()

if S == T[:-1]:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
import sys

s = input()
k = int(input())

for n in s[:k]:
    if int(n) > 1:
        print(n)
        sys.exit()
print(1)
# Judge status: Accepted
print("YNeos"[''.join(sorted(input()))!="abc"::2])
# Judge status: Accepted
S = input()

mem = True
for i, s in enumerate(S):
    if (i+1)%2 == 1:
        if not s in ['R', 'U', 'D']:
            mem *= False
    else:
        if not s in ['L', 'U', 'D']:
            mem *= False
if mem:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
x,y = map(int, input().split())
if x!= y and min(x,y) == x: print(x)
elif x%y == 0: print(-1)
else:
  for i in range(1, 10**9//x):
    if x ** i % y != 0: 
      print(x**i)
      exit()
# Judge status: Accepted
N = int(input())
S = list(input())
count = S.count("R")*S.count("B")*S.count("G")
for i in range(N):
    for j in range(i+1,N):
        if 2*j-i < N:
            if S[i]!=S[j] and S[2*j-i]!=S[i] and S[2*j-i]!=S[j]:
                count-=1
print(count)
# Judge status: Accepted
s = [list(input()) for _ in range(3)]

n_row = 0

dic = {0:"A",1:"B",2:"C"}

while len(s[n_row]):
    s_num = s[n_row].pop(0)
    
    if s_num == "a":
        n_row = 0
    elif s_num == "b":
        n_row = 1
    elif s_num =="c":
        n_row = 2

print(dic[n_row])
# Judge status: Accepted
import sys
import bisect
import heapq

sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline

def main():
    a,b,c = map(int,read().split())
    if a <= c and c <= b:
        print("Yes")
    else:
        print("No")

if __name__ == '__main__':
    main()
# Judge status: Accepted
a = [int(s) for s in input().split()]
if a[1] > a[2]:
    print("0")
elif a[1] == a[2]:
    print("1")
elif a[0] == 1:
    print("0")
else:
    mini = a[2] + a[1] * (a[0] - 1)
    maxi = a[1] + a[2] * (a[0] - 1)
    print(int(maxi) - int(mini) + 1)
# Judge status: Wrong Answer
n,a,b=map(int,input().split())
s=input()
num=0
count=0
for i in s:
    if i=="a" and num<a+b:
        num+=1
        count+=1
        print("Yes")
    elif i=="b" and num<a+b and count<=b:
        num+=1
        count+=1
        print("Yes")
    else:
        print("No")
# Judge status: Accepted
# import time


A = int(input())
B = int(input())
C = int(input())
X = int(input())
# t1 = time.time()
ans = 0

for i in range(0,A+1):
    for j in range(0,B+1):
        for k in range(0,C+1):
            if 500*i+100*j+50*k == X:
                ans +=1

print(ans)
# t2 = time.time()
# print(t2-t1)
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    n, x = map(int, input().split())
    l = tuple(map(int, input().split()))

    d = 0
    for i in range(1, n+1):
        d += l[i-1]
        if d > x:
            print(i)
            quit()
    else:
        print(n+1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
S = input()
mod_bucket = [0] * 2019
mod_bucket[0] += 1

_S = S[::-1]
mod = 0
p = 1
for i in range(len(S)):
    mod = (p * int(_S[i]) + mod) % 2019
    mod_bucket[mod] += 1
    p *= 10
    p %= 2019

ans = sum([mod*(mod-1)/2 for mod in mod_bucket])
print(int(ans))
# Judge status: Wrong Answer
res=[]
for i in range(3):
  a=list(map(int,input().split()))
  res.append(a)
N=int(input())
for i in range(N):
  b=int(input())
  for j in range(3):
    if b in res[j]:
      res[j][res[j].index(b)]=0
print(res)
if res[0]==0 or res[1]==0 or res[2]==0:
  print('Yes')
elif res[0][0]==0 and res[1][1]==0 and res[2][2]==0:
  print('Yes')
elif res[2][0]==0 and res[1][1]==0 and res[0][2]==0:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N = int(input())
odd = 0
if N%2 == 0:
  odd = N/2
else:
  odd = int(N/2 + 1)
  
print(odd/N)
# Judge status: Accepted
print('YES' if input() in '357' else 'NO')
# Judge status: Accepted
A, B = map(int, input().split())
print(int((A+B)/2) if (A+B)%2 == 0 else "IMPOSSIBLE" )
# Judge status: Accepted
N,M=map(int,input().split())
A=[int(i) for i in input().split()]
print(max(N-sum(A),-1))
# Judge status: Wrong Answer
N = int(input())
X = input()
counter = []
prev = "("
count = 0
for i, x in enumerate(X):
  if prev != x:
    prev = x
    counter.append(count)
    count = 0
  if x == "(":
    count += 1
  else:
    count -= 1
counter.append(count)
if len(counter) % 2 == 1:
  counter.append(0)
#print(counter)
result = ""
for i in range(0, len(counter), 2):
  result += "(" * max(list(map(abs,counter[i:i+2])))
  result += ")" * max(list(map(abs,counter[i:i+2])))
print(result)
# Judge status: Accepted
n, m = map(str, input().split())
a, b = map(int, input().split())
u = str(input())

if n==u:
  a=a-1
  
if m==u:
  b=b-1

print(a ,b)
# Judge status: Wrong Answer
import math
X = int(input())
N = math.floor((2*X)**(0.5))
if X==1 or X==2: print(X)
else: print(N+(2*X-N*(N+1))//2)
# Judge status: Accepted
# -*- coding: utf-8 -*-
from sys import stdin
input = stdin.readline

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

A.sort()

print(A[0] + A[1])
# Judge status: Accepted
import sys

input = sys.stdin.readline


def solve():
    t_stamina, t_attack, a_stamina, a_attack = map(int, input().split())
    t_num_attack_to_be_beaten = - (-t_stamina // a_attack)
    a_num_attack_to_be_beaten = - (-a_stamina // t_attack)

    if t_num_attack_to_be_beaten >= a_num_attack_to_be_beaten:
        return 'Yes'
    else:
        return 'No'


if __name__ == '__main__':
    answer = solve()
    print(answer)
# Judge status: Accepted
n=int(input())
s=list(map(ord,list(str(input()))))
for i in range(len(s)):
    s[i]=s[i]+n
    if s[i]>90:
        s[i]-=26
    s[i]=chr(s[i])
s=''.join(s)
print(s)
# Judge status: Wrong Answer
from collections import Counter


def main():
    N = int(input())
    A = list(map(int, input().split(' ')))
    counter = Counter(A)
    dupl_bars = [length for length, cnt in counter.items() if cnt > 1]
    dupl_bars.sort(reverse=True)
    if len(dupl_bars) > 1:
        print(dupl_bars[0] * dupl_bars[1])
    else:
        print(0)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n=int(input())
S=list(input())
W=[0]*(n+1)
B=[0]*(n+1)
for i in range(n):
  if S[i]=="#":
    B[i+1]=B[i]+1
  else:
    B[i+1]=B[i]
for i in range(n-1,-1,-1):
  if S[i]==".":
    W[i]=W[i+1]+1
  else:
    W[i]=W[i+1]
ans=10**10
for i in range(n+1):
  a=W[i]+B[i]
  if a<ans:
    ans=a
print(ans)
# Judge status: Accepted
N,M=map(int,input().split())
H=list(map(int,input().split()))
ans=[1]*N
for _ in range(M):
    A,B=map(int,input().split())
    if H[A-1]<=H[B-1]:
        ans[A-1]=0
    if H[B-1]<=H[A-1]:
        ans[B-1]=0
print(sum(ans))
# Judge status: Wrong Answer
n,m=[int(i) for i in input().split()]
new_n=min(n,m)
new_m=max(n,m)

def ans(n,m):
    mod=10**9+7
    if n==m:
        return 2*kaijyou(n,mod)*kaijyou(m,mod)
    elif m-n==1:
        return kaijyou(n,mod)*kaijyou(m,mod)
    else:
        return 0


def kaijyou(n,mod):
    ans=1
    for i in range(1,n+1):
        ans*=i
        ans=ans%mod
    return ans
print(ans(new_n,new_m))
# Judge status: Wrong Answer
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
d=0
for i in range(1,a+1):
  if b<=(i//10+(i-(i//10)*10))<=c:
    d=d+i
print(d)
# Judge status: Wrong Answer
S = list(input())
A_check = []
C_check = []
lower_check = []

for i in range(len(S)):
    if S[i] == 'A':
        A_check.append(i)
    
    if S[i] == 'C':
        C_check.append(i)
    
    if S[i].islower():
        lower_check.append(i)
        

if len(A_check) != 1 or len(C_check) != 1 or len(lower_check) != (len(S) - 2):
    print('No')
elif A_check[0] != '0' or C_check[0] == len(S) - 1 or C_check[0] < 2:
    print('No')
else:
    print('Yes')
# Judge status: Accepted
n,k,q=map(int,input().split())
a=[]
for i in range(q):
    a.append(int(input()))
ans=[-1]+[0]*n

for i in range(q):
    ans[a[i]]+=1

for i in range(1,n+1):
    if k-(q-ans[i])>0:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
n = int(input())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
c = list(map(int,input().split()))
if a[n-1] == n:
  print(sum(b)+sum(c))
else:
  print(sum(b)+sum(c)-c[n-2])
# Judge status: Wrong Answer
N, X = map(int, input().split())
L_list = list(map(int, input().split()))

D = 0
count = 0
for L in L_list:
    if D <= X:
        count += 1
    else:
        break
    D += L
print(count)
# Judge status: Accepted
n = int(input())
numbers = list(map(int, input().split()))
numbers.sort()

ai = numbers[-1]
r = ai / 2

for i in range(n - 1):
    if numbers[i] == r:
        ans = [ai, int(r)]
        break
    if numbers[i] > r:
        if numbers[i] - r < r - numbers[i - 1]:
            ans = [ai, numbers[i]]
        break
    ans = [ai, numbers[i]]

print(*ans)
# Judge status: Accepted
import math

K = int(input())
print(math.ceil(K / 2) * math.floor(K / 2))
# Judge status: Accepted
import collections
import heapq
n = int(input())
p = list(map(int, input().split()))
c = collections.Counter(p)
cond = 0
h = []
for line, cnt in c.most_common():
  if(cnt >= 2):
    for _ in range(cnt // 2):
      heapq.heappush(h, int(-1*line))
if(len(h) < 2):
  print(0)
  exit()
print(heapq.heappop(h) * heapq.heappop(h))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = [0] * n
for i in range(n):
  ans[a[i] - 1] = i + 1
  
print(' '.join(map(str, ans)))
# Judge status: Accepted
N = int(input())
L = list(map(int, input().split()))[:N]

start = round(sum(L) / N)
f = lambda x: (x - start)**2

print(sum(list(map(f, L))))
# Judge status: Accepted
s = list(input())

for i in range(len(s)):
    s.pop(-1)
    if len(s)%2==0:
        if s[:len(s)//2] == s[len(s)//2:]:
            print(len(s))
            break
# Judge status: Accepted
s = input()
s = '2018' + s[4:]
print(s)
# Judge status: Accepted
def dfs(x):
    ans.append(x)
    if len(str(x))==10:
        return
    
    last=x%10
    
    for i in [last-1,last,last+1]:
        if 0<=i<=9:
            dfs(10*x+i)

k=int(input())
ans=[]
for i in range(1,10):
    dfs(i)
    
ans=sorted(ans)
print(ans[k-1])
# Judge status: Wrong Answer
n = input()
ans = 0
for i in range(len(n)):
    nn = int(n[i])
    if nn >= 5:
        ans += (10-nn)
    elif nn != 0:
        ans += nn
if n[-1] != '0':
    ans += 1
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    A = list(map(int, input().split()))

    mod = 10**9+7
    ans = 0

    for k in range(60):
        x, y = 0, 0
        for a in A:
            x += 1 & a>>k
        tmp = x*(n-x)%mod
        tmp *= pow(2, k, mod)
        ans += tmp
        ans %= mod
    print(ans)


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

MM = ['01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12']

if S[0:2] in MM and S[2:4] in MM:
  print('AMBIGUOUS')
elif S[0:2] in MM:
  print('MMYY')
elif S[2:4] in MM:
  print('YYMM')
else:
  print('NA')
# Judge status: Accepted
n = int(input())
p = list(map(int, input().split()))
c = 0
for i in range(1,n-1):
  if (p[i-1] < p[i] < p[i+1]) or (p[i-1] > p[i] > p[i+1]):
    c += 1
print(c)
# Judge status: Wrong Answer
N = int(input())
a = [input() for _ in range(N)]

d = dict()
for x in a:
  s = ''.join(sorted(x))
  if s not in d.keys():
    d[s] = 0
  else:
    d[s] += 1

print(sum(d.values()))
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
 
def main():
    n, k = map(int, readline().split())
    print((((n-k)+(k-1)-1)//(k-1))+1)
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections

def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
n = int(input())
a = sorted(list(map(int,input().split())))
d = a[0]
for i in range(n-1):
    d = gcd(d,a[i])
print(d)
# Judge status: Wrong Answer
X=int(input())
X=X-100+1
print(X)
# Judge status: Accepted
from collections import Counter
n = int(input())
a = list(map(int, input().split()))
c = Counter(a)
ans = 0
for k, v in c.items():
    if v-k<0: ans+=v
    else: ans+=min(v-k, v)
print(ans)
# Judge status: Accepted
n = int(input())
print(
    - (n//15) * 200 + 800 * n
)
# Judge status: Wrong Answer
A, B ,N = map(int,input().split())
x = 0
max = 0
while True:
  result = int((A*x)/B) - (A*int(x/B))
  if result > max:
    max = result
  if x/B >= 1:
    break
  x = x + 1
print(max)
# Judge status: Accepted
C=[]
for _ in range(3):
    a = list(map(int, input().split()))
    b = min(a)
    for i in range(3):
        a[i] -= b
    C.append(a)
if C[0] == C[1] == C[2]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
n = int(input())
res = 0
for i in range(1, n + 1):
    temp = i
    cnt = 0
    for j in range(1, temp + 1):
        if temp % i == 0:cnt += 1
    
    if cnt == 8:res += 1
print(res)
# Judge status: Accepted
#C

s = list(input())
zero = 0
one = 0
for i in s:
    if i == "1":
        one += 1
    else:
        zero += 1
print(2*min(one, zero))
# Judge status: Accepted
a,b=map(int,input().split())
if a==1:
    a=14
if b==1:
    b=14
print("Alice"if a>b else "Bob" if b>a else "Draw" )
# Judge status: Wrong Answer
n,a,b=map(int,input().split())
katamari=n//(a+b)
amari=n%(a+b)
print(a*katamari+amari)
# Judge status: Accepted
s = input()
t = ['A','C','G','T']

ans = 0
tmp_ans = 0
for i in s:
    if i in t:
        tmp_ans += 1
    else:
        ans = max(tmp_ans, ans)
        tmp_ans = 0
ans = max(tmp_ans, ans)
print(ans)
# Judge status: Accepted
A, B, C, X, Y = map(int, input().split())

ans = float("inf")

# 全部ミックスピザ
ans = min(2 * C * max(X, Y), ans)
# 普通に買う
ans = min(A * X + B * Y, ans)
# 多少はミックスも買う
if X >= Y:
    tmp = 2 * C * Y
    tmp += min((X - Y) * A, 2 * (X - Y) * C)
    ans = min(tmp, ans)
else:  # X < Y
    tmp = 2 * C * X
    tmp += min((Y - X) * B, 2 * (Y - X) * C)
    ans = min(tmp, ans)

print(ans)
# Judge status: Accepted
N, A, B = map(int, input().split())
S = input()
passed = 0
rank = 0
for i in range(N):
    is_pass = False
    if S[i] == 'a' and passed < A+B:
        is_pass = True
    elif S[i] == 'b':
        if passed < A+B and rank < B:
            is_pass = True
        rank += 1
    if is_pass:
        passed += 1
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
n = int(input())
action = []
for i in range(n):
    action.append([int(i) for i in input().split()])
df = []
df.append(max(action[0]))
prev = action[0].index(max(action[0]))
for i in range(1, n):
    tgt = max([action[i][j] for j in range(len(action[i])) if j != prev])
    prev = action[i].index(tgt)
    df.append(tgt)
print(sum(df))
# Judge status: Wrong Answer
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

n = ri()
if n > 999:
  print(f'ABC{n}')
else:
  print(f'ABD{n-999}')
# Judge status: Wrong Answer
x = int(input())
a = 100
count = 0
while a <= x:
    a *= 1.01
    count += 1
print(count)
# Judge status: Accepted
A,V = map(int,input().split())
B,W = map(int,input().split())
T   = int(input())

if V <= W:
    print("NO")
elif (abs(A-B)/abs(V-W)) <= T:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))

ans = 1

if 0 in a:
    ans = 0
else:
    for x in a:
        ans *= x
        if ans > 10**18:
            ans = -1
            break

print(ans)
# Judge status: Accepted
a,b,k = map(int,input().split())
from fractions import gcd
ans = gcd(a,b)
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
print(make_divisors(ans)[::-1][k-1])
# Judge status: Accepted

A,B,C,X,Y=map(int,input().split())

anslist=[]

for i in range(0,2*max(X,Y)+1,2):
    ans=C*i
    if X>i//2:
        ans=ans+A*(X-i//2)
    if Y>i//2:
        ans=ans+B*(Y-i//2)
    anslist.append(ans)
print(min(anslist))
# Judge status: Accepted
s = input()
if len(s) % 2 == 1:
    s = s[:-1]
else:
    s = s[:-2]
while True:
    if s[:len(s)//2] == s[len(s)//2:]:
        print(len(s))
        exit()
    else:
        s = s[:-2]
# Judge status: Accepted
def inp():return map(int,input().split())
a,b=inp()
if (a+b)%2==0:print((a+b)//2)
else:print("IMPOSSIBLE")
# Judge status: Accepted
K = int(input())
a = 0
ans = -1
for i in range(10**7):
    a = (a*10+7) % K
    if a == 0:
        ans = i+1
        break
print(ans)
# Judge status: Wrong Answer
s=input()
ans = 0
for i in range(len(s)//2):
  if s[:i]==s[i:i*2]:
    ans=i+1
print(ans)
# Judge status: Wrong Answer
a, b, x = map(int, input().split())
if a+b-1 >= x:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import numpy as np

def main():
    n = int(input())
    mob=np.array(list(map(int,input().split())),dtype=int)
    bra=np.array(list(map(int,input().split())),dtype=int)
    ans=0

    for i in range(n):
        ans += min(mob[i],bra[i])
        ans += min(mob[i+1],bra[i]-min(mob[i],bra[i]))
        mob[i+1]-=min(mob[i+1],bra[i]-min(mob[i],bra[i]))
    print(ans)


if __name__=="__main__":
    main()
# Judge status: Accepted
n=int(input())
print(n*(1+n)//2)
# Judge status: Wrong Answer
a = list(input().split())
a1 = "".join(a)
c = reversed(a)
c1 = "".join(c)


def b():
    if len(a1) <= 5:
        return 0
    if a1 == c1:
        return 1
    else:
        return 0


if b() == 0:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
s = input()
a=0
b=0
for i in range(len(s)):
  if s[i]=='A':
    a = i
    break
for i in range(len(s)-1,-1,-1):
  if s[i] == 'Z':
    b = i
    break
print(b-a+1)
# Judge status: Accepted
s=input()
t=input()
total=False
for i in range(len(s)):
    s=s[len(s)-1]+s[0:len(s)-1]
    if s==t:
        print("Yes")
        total=True
        break
if total==False:
    print("No")
# Judge status: Accepted
N = int(input())

A = [int(i) for i in input().split()]

if N == 0 and A[0] != 1:
    print(-1)
    exit()

nodes = [0] * (N+1)
nodes[0] = 1
for i in range(1, N+1):
    node = (nodes[i-1]-A[i-1])*2
    if node < A[i]:
        print(-1)
        exit()
    nodes[i] = node

#print(nodes)

nodes[-1] = A[-1]
for i in range(N-1, -1, -1):
    nodes[i] = min(nodes[i], nodes[i+1]+A[i])

#print(nodes)

print(sum(nodes))
# Judge status: Accepted
import sys


if __name__ == "__main__":
    n = int(input())
    a = list(map(int,input().split()))
    pref = [a[0]]
    cost = 10**18
    for  i in range(1,n):
        pref.append(pref[i-1] + a[i])
    for i in range(n):
        d1 = pref[i]
        d2 = pref[-1] - pref[i]
        cost = min(cost,abs(d1-d2))
    print(cost)
# Judge status: Accepted
N = int(input())
A = int(input())
print('Yes' if N%500<=A else 'No')
# Judge status: Wrong Answer
n,m=map(int,input().split())
if n==0: 
    print((n*(n-1))/2)
elif m==0:
    print((m*(m-1))/2)
else:
    print((n*(n-1))/2+(m*(m-1))/2)
# Judge status: Accepted
n, m = map(int, input().split())
a = list(map(int, input().split()))
days = sum(a)
# print(-1) if n - days < 0 else print(n-days)
print(max(-1, n-days))  # ←賢い
# Judge status: Wrong Answer
#ABC 113 B - Palace
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
result = [float("inf")] * len(H) 
Max = float("inf")
for i in range(len(H)):
    result[i] = int(T - H[i] * 0.006)
for i in range(len(result)):
    if(abs(A - result[i]) <= Max):
        resultNum = i
        Max = abs(A-result[i])
print(resultNum + 1)
# Judge status: Accepted
s=input()
si=s[::-1]
a=s[:(len(s)-1)//2]
b=s[(len(s)+1)//2:]
if s == si :
    if a == a[::-1] and b == b[::-1]:
        print(("Yes"))
        exit()
print("No")
# Judge status: Accepted
N=int(input())
if N%2==1:
    print((N//2+1)*(N//2))
else:
    print((N//2)**2)
# Judge status: Wrong Answer
N,x = map(int,input().split())
a = list(map(int,input().split()))
a.sort()
cnt = 0
for elem in a:
  if x >= elem:
    cnt += 1
    x -= elem
  else:
    break
print(cnt)
# Judge status: Accepted
X, Y = map(int, input().split())

ans = 0

while X <= Y:
    X *= 2
    ans += 1

print(ans)
# Judge status: Accepted
n, m = map(int, input().split())

divisors = []
for i in range(1, int(m**0.5)+1):
    if m % i == 0:
        divisors.append(i)
        if i != m // i:
            divisors.append(m // i)
divisors.sort()

print([i for i in divisors if i <= m/n][-1])
# Judge status: Accepted
n,k = map(int,input().split())
A = list(map(int,input().split()))
imos = [0]*(n+1)
for j in range(k):
    if j==0:
        arr = A
    else:
        arr = imos
    imos = [0]*(n+1)
    for i,a in enumerate(arr):
        imos[max(i-a, 0)] += 1
        imos[min(i+a+1, n)] -= 1
    for k in range(1, len(imos)):
        imos[k] = imos[k]+imos[k-1]
    imos = imos[:-1]
    if set(imos)=={n}:
        break
print(*imos)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
cnt = {}
for x in a:
    if x not in cnt:cnt[x] = 1
    else:cnt[x] +=1
ans = 0
for key in cnt:
    res = 0
    if key in cnt:res += cnt[key]
    if key-1 in cnt:res += cnt[key-1]
    if key+1 in cnt:res += cnt[key+1]
    ans = max(ans,res)
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
A.sort()

ans = "YES"
for i in range(N-1):
    if A[i] == A[i+1]:
        ans = "NO"

print(ans)
# Judge status: Accepted
from sys import stdin

q, h, s, d = map(int, stdin.readline().rstrip().split())
n = int(stdin.readline().rstrip())
q *= 4
h *= 2
t = min(q, h, s)
if 2 * t > d:
    print((n // 2) * d + (n % 2) * t)
else:
    print(n * t)
# Judge status: Accepted
a=int(input())
b=int(input())
c=int(input())
x=int(input())
num=0
if a*500+b*100+c*50<x:
    print(0)
else:
    for i in range(0,a+1):
        for j in range(0,b+1):
            for k in range(0,c+1):
                if 500*i+100*j+50*k==x:
                    num+=1
    print(num)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
import collections
c = collections.Counter(l)
ans1=[]
ans2=[0]
for x in c.keys():
  if c[x]>1:
    ans1.append(x)
  if c[x]>3:
    ans2.append(x)
ans1.sort()
if len(ans1)<2:
  print(0)
else:
  print(max(ans1[-1]*ans1[-2],max(ans2)**2))
# Judge status: Accepted
A, B = map(int, input().split())
n = 1
cnt = 0
while n < B:
    n += A-1
    cnt += 1
print(cnt)
# Judge status: Wrong Answer
s=input()
ans = 653
for i in range(len(s)-3):
    x = abs(753 - int(s[i:i+3]))
    ans = min(ans,x)
print(ans)
# Judge status: Accepted
N = input()
good_ints = (str(i) * 3 for i in range(9 + 1))
answer = ''

for good_int in good_ints:
    if good_int in N:
        answer = 'Yes'
        break
        
print(answer if answer else 'No')
# Judge status: Wrong Answer
S=input()
T=input()
S1=list(S)
T1=list(T)

for i in range(len(S1)):
    if(S1[i]!=T1[i]):
        S1[i]=T1[i]
    
print(i)