Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

import bisect

n = int(input())
s = list(map(int, input().split(" ")))
# n = 18
# s = list(reversed(range(1, 2 ** n + 1)))

s = sorted(s)
from collections import deque

def solve():
    parents = [s[-1]]
    s.pop()

    for i in range(n):
        newparents = list(parents)
        # print(parents)
        for p in parents:
            k = bisect.bisect(s, p - 1) - 1
            # print(p, s, k)
            if k == -1:
                print("No")
                exit(0)
            newparents.append(s[k])
            s.pop(k)
        parents = sorted(newparents, reverse=True)

    # print(parents)
    # print(k)
    if k == len(s):
        print("Yes")
    else:
        print("No")
solve()


### FIXED CODE ###

import bisect

n = int(input())
s = list(map(int, input().split(" ")))
# n = 18
# s = list(reversed(range(1, 2 ** n + 1)))

s = sorted(s)
from collections import deque

def solve():
    global s

    parents = [s[-1]]
    s.pop()

    for i in range(n):
        newparents = list(parents)
        k = len(s)
        dropped = set()
        # print(parents)
        for p in parents:
            oldK = k
            k = bisect.bisect(s, p - 1, 0, k) - 1
            # print("Old", oldK, k, s[k], p)
            if k == -1:
                print("No")
                exit(0)

            newparents.append(s[k])
            dropped.add(k)
        s = [x for i, x in enumerate(s) if i not in dropped]
        parents = sorted(newparents, reverse=True)

    # print(parents)
    # print(k)
    if k == len(s):
        print("Yes")
    else:
        print("No")
solve()
### BUGGY CODE ###

N, Q = map(int, input().split())
S = input()
L = len(S)
target = 'AC'
shiftID = len(target) - 1

found_id = []

for i in range(L-shiftID):
    if S[i:i+len(target)] == target:
        found_id.append(i)


for _ in range(Q):
    l, r = map(int, input().split())
    l -= 1
    r -= 1

    ans = 0
    for i in found_id:

        if l <= i and i+shiftID <= r:
            ans += 1
        elif r < i + shiftID:
            break

    print(ans)


### FIXED CODE ###

N, Q = map(int, input().split())
S = input()
target = 'AC'
shiftID = len(target) - 1

found_id = []

for i in range(N-shiftID):
    if S[i:i+len(target)] == target:
        found_id.append(i)

found_count = [0 for _ in range(N+1)]

for i in range(shiftID+1, N+1):
    found_count[i] = found_count[i-1] + (1 if S[i-shiftID-1:i]=='AC' else 0)

for _ in range(Q):
    l, r = map(int, input().split())
    print(found_count[r] - found_count[l])
### BUGGY CODE ###

from bisect import bisect_left
 
n = int(input())
l = list(map(int, input().split()))
l.sort()

c = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    c += bisect_left(l[j+1:], l[i]+l[j])
 
print(c)



### FIXED CODE ###

from bisect import bisect_left
 
n = int(input())
l = list(map(int, input().split()))
l.sort()
 
c = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    c += bisect_left(l, l[i]+l[j]) - j - 1
 
print(c)
### BUGGY CODE ###

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

a_max = a[-1]
ans_list = [0] * a_max

ans = 0

for i in range(n):

    p = a[i]
    if a.count(p) > 1:
        continue

    if ans_list[p-1] == 0:
        for q in range(1, (a_max//p)+1):
            ans_list[p*q-1] = 1
            
        ans += 1

print(ans)


### FIXED CODE ###

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

a_max = a[-1]
ans_list = [0] * a_max

ans = 0

for i in range(n-1):

    p = a[i]

    if ans_list[p-1] == 0:
        for q in range(1, (a_max//p)+1):
            ans_list[p*q-1] = 1
            
        if a[i] != a[i+1]:
            ans += 1

if ans_list[a_max-1] == 0:
    ans += 1

print(ans)
### BUGGY CODE ###

n = int(input())
c = list(input())
sc = list(reversed(c))
ans = 0
r = 0
flg  = False

if 'W' not in set(c) or 'R' not in set(c):
    print(ans)


else:
    for i in range(n):
        if flg:
            break
        if c[i] == 'W':
            for j in range(r, n):
                r += 1
                if sc[j] == 'R':
                    if n >= i+j+2:
                        c[i] = 'R'
                        c[-1*j-1] = 'W'
                        ans += 1
                        sc = list(reversed(c))
                        break
                    else:
                        flg = True
                        break

                
            

    print(ans)

### FIXED CODE ###

n = int(input())
c = list(input())
sc = list(reversed(c))
ans = 0
r = 0
flg  = False

if 'W' not in set(c) or 'R' not in set(c):
    print(ans)


else:
    for i in range(n):
        if flg:
            break
        if c[i] == 'W':
            for j in range(r, n):
                r += 1
                if sc[j] == 'R':
                    if n >= i+j+2:
                        c[i] = 'R'
                        c[-1*j-1] = 'W'
                        ans += 1
                        break
                    else:
                        flg = True
                        break

                
            

    print(ans)
### BUGGY CODE ###

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

i = 1
j = 0

while j < N and i in set(a[j:]):
    j = a[j:].index(i) + j
    # print(i, j)
    i += 1

if 1 in set(a):
    print(N - i + 1)
else:
    print(-1)

### FIXED CODE ###

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

i = 1
# j = 0

if 1 in set(a):
    # while j < N and i in set(a[j:]):
    #     j = a[j:].index(i) + j
    #     # print(i, j)
    #     i += 1
    for a_i in a:
        if a_i == i:
            i += 1
    print(N - i + 1)
else:
    print(-1)
### BUGGY CODE ###

n,q=map(int,input().split())
s=input()
l=[0]*q
r=[0]*q
c=0
for i in range(q):
    l[i],r[i]=map(int,input().split())
for i in range(q):
    for j in range(l[i],r[i]):
        if s[j-1]=='A':
            if s[j]=='C':
                c+=1
    print(c)
    c=0

### FIXED CODE ###

n,q=map(int,input().split())
s=input()
l=[0]*q
r=[0]*q
c=[0]*n
ans=0
for i in range(q):
    l[i],r[i]=map(int,input().split())
if s[0]=='A' and s[1]=='C':
    c[0]=1
for i in range(1,n-1):
    if s[i]=='A' and s[i+1]=='C':
        c[i]=c[i-1]+1
    else:
        c[i]=c[i-1]
for i in range(q):
    print(c[r[i]-2]-c[l[i]-2])
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
ans =0
for i in set(a):
    k=a.count(i)
    if i>k:
        ans+=k
    elif i<k:
        ans+=k-i
print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
ans =0
import collections
c = collections.Counter(a)
for i in c.keys():
    if c[i]>i:
        ans+=c[i]-i
    elif c[i]<i:
        ans+=c[i]
print(ans)
### BUGGY CODE ###

import heapq
import math

def resolve():
    _,k = list(map(int, input().split()))
    A = list(map(int, input().split()))
    heap = []
    for a in A:
        heapq.heappush(heap, (-a, -a, 1))
    
    while k > 0:
        a = heapq.heappop(heap)
        origin = a[1]
        denom = a[2]
        denom += 1
        new = (origin/denom, origin, denom)
        heapq.heappush(heap, new)
        k -= 1

    a = heapq.heappop(heap)
    ans = a[0]*-1
    print(math.ceil(ans))
    
resolve()

### FIXED CODE ###

import math

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

    start = 0
    end = 10**9

    while end - start > 1:
        cnt = 0
        mid = (start + end) // 2
        for a in A:
            cnt += math.ceil(a/mid) - 1
        if cnt <= K:
            end = mid
        else:
            start = mid

    print(end)
    
resolve()
### BUGGY CODE ###

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

# print(A)
cur = 1
Npush = 0
History = []
while 1:
    History.append(cur)
    cur = A[cur-1]
    Npush+=1
    if cur == 2:
        break
    elif cur in History:
        Npush=-1
        break
    # print(cur)
print(Npush)


### FIXED CODE ###

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))

# print(A)
cur = 1
Npush = 0
# History = []
# while 1:
#     History.append(cur)
#     cur = A[cur-1]
#     Npush+=1
#     if cur == 2:
#         break
#     elif cur in History:
#         Npush=-1
#         break
for i in range(N+1):
    cur = A[cur-1]
    Npush += 1
    if cur == 2:
        break
    # print(cur)
if cur==2:
    print(Npush)
else:
    print(-1)
### BUGGY CODE ###

n = int(input())
p = 1
for i in range(1,n+1):
  p *= i
print(p%((10**9)+7))

### FIXED CODE ###

import math

n = int(input())
C = 10**9 + 7
print(math.factorial(n)%C)
### BUGGY CODE ###

N = int(input())
A = [int(input()) for n in range(N)]

maxA = max(A)
for n in range(N):
  if A[n] != maxA:
    print(maxA)
  else:
    a = A[n]
    A[n] = 0
    print(max(A))
    A[n] = a

### FIXED CODE ###

N = int(input())
A = [int(input()) for n in range(N)]
 
max_A = max(A)
max_index = A.index(max(A))

A[max_index] = 0
max_A2 = max(A)
A[max_index] = max_A

for n in range(N):
  if A[n] != max_A:
    print(max_A)
  else:
    print(max_A2)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
import itertools
import sys
import math
from functools import lru_cache

# 1整数
# n = int(input())

# 空白区切り2変数
from queue import Queue
from operator import mul
from functools import reduce
from queue import Queue
from operator import mul
from functools import reduce
from functools import lru_cache

input = sys.stdin.readline

# N個整数
x, y, z, kk = list(map(int, input().split()))

# 1整数
# n = int(input())

# 空白区切りリスト整数
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)


ll = [0] * 10000000
count = 0
for i in range(len(a)):
    for j in range(len(b)):
        if i * j > kk:

            break
        for k in range(len(c)):
            if i * j * k > kk:
                break
            ll[count] = a[i] + b[j] + c[k]
            count += 1
ll.sort(reverse=True)

for i in range(kk):
    print(ll[i])

# 空白区切り文字列
# t, d = input().split()


### FIXED CODE ###

# -*- coding: utf-8 -*-
import itertools
import sys
import math
from functools import lru_cache

# 1整数
# n = int(input())

# 空白区切り2変数
from queue import Queue
from operator import mul
from functools import reduce
from queue import Queue
from operator import mul
from functools import reduce
from functools import lru_cache

input = sys.stdin.readline

# N個整数
x, y, z, kk = list(map(int, input().split()))

# 1整数
# n = int(input())

# 空白区切りリスト整数
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort(reverse=True)
b.sort(reverse=True)
c.sort(reverse=True)


ll = []
count = 0
for i in range(len(a)):
    for j in range(len(b)):
        if i * j > kk:

            break
        for k in range(len(c)):
            if i * j * k > kk:
                break
            ll.append(a[i] + b[j] + c[k])
ll.sort(reverse=True)

for i in range(kk):
    print(ll[i])

# 空白区切り文字列
# t, d = input().split()
### BUGGY CODE ###

R, G, B, N = map(int, input().split())

S = min(R, G, B)
L = max(R, G, B)
M = R + G + B - S - L

cnt = 0
sum = 0
for i in range(N // L + 1)[::-1]:
    for j in range(N // M + 1)[::-1]:
        for k in range(N // S + 1):
            sum = N - i * L - j * M - k * S  
            if sum == 0:
                cnt += 1
            if sum < 0:
                break
print(cnt)


### FIXED CODE ###

R, G, B, N = map(int, input().split())

S = min(R, G, B)
L = max(R, G, B)
M = R + G + B - S - L

cnt = 0
sum = 0
for i in range(N // L + 1)[::-1]:
    for j in range(N // M + 1):
        sum = N - i * L - j * M
        if sum < 0:
            break
        if sum % S == 0:
            cnt += 1
print(cnt)
### BUGGY CODE ###

n = int(input())
p = list(map(int, input().split()))
print(sum(p[i] <= min(p[:i + 1]) for i in range(n)))

### FIXED CODE ###

n = int(input())
an = [int(i) for i in input().split()]
lowe, min_an_sub = 0, an[0]
an_sub = []
for i in range(0, n):
    an_sub.append(an[i])
    min_an_sub = min(min_an_sub, an[i])
    if an_sub[i] <= min_an_sub:
        lowe += 1
print(lowe)
### BUGGY CODE ###

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

# point = [0] * (N - K + 1)
tmplist = A[0:K]
tmppoint = tmplist[0]
for j in range(1, K):
    tmppoint = tmppoint * tmplist[j]
point = tmppoint


for i in range(1, N - K + 1):
    tmplist = A[i : i + K]
    tmppoint = tmplist[0]

    for j in range(1, K):
        tmppoint = tmppoint * tmplist[j]

    if point < tmppoint:
        print("Yes")
    else:
        print("No")

    point = tmppoint



### FIXED CODE ###

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

i = 0
while i < N - K:
    if A[i] < A[i + K]:
        print("Yes")
    else:
        print("No")
    i = i + 1
### BUGGY CODE ###

import math
n = int(input())

def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True

if is_prime(n):
    print(len(str(n)))
    exit()

rtn = math.floor(math.sqrt(n))

for i in range(rtn,n+1):
    if n % i == 0:
        print(len(str(i)))
        exit()

### FIXED CODE ###

import math
n = int(input())

# def is_prime(n):
#     if n == 1:
#         return False
#     for i in range(2,int(n**0.5)+1):
#         if n % i == 0:
#             return False
#     return True

# if is_prime(n):
#     print(len(str(n)))
#     exit()

# rtn = math.floor(math.sqrt(n))

# for i in range(rtn,n+1):
#     if n % i == 0:
#         print(len(str(i)))
#         exit()

# n = a * b = b * aでなのでa<=bのaの方を求めてその時のbの桁数出力すれば間に合う。
# 上記のようにbの方から求めるとぎり間に合わない。

rtn = math.ceil(math.sqrt(n))
for i in reversed(range(1, rtn + 1)):
    if n % i == 0:
        b = n // i #求めるのはa(=i)ではなくbの方
        print(len(str(b)))
        exit()
### BUGGY CODE ###

import queue
N=int(input())
A=sorted([int(i) for i in input().split()],reverse=True)
B=[2**(len(bin(i))-2) for i in A]
R=[0 for i in range(N)]
D=dict()
for i in range(N):
    if not(A[i] in D):
        D[A[i]]=queue.Queue()
    D[A[i]].put(i)
ans=0
for i in range(N):
    if R[i]==1:
        continue
    if B[i]==2*A[i]:
        if A[i] in D:
            flag=0
            x=0;y=0
            if not(D[A[i]].empty()):
                x=D[A[i]].get()
                flag=1
            if flag==1 and not(D[A[i]].empty()):
                y=D[A[i]].get()
                flag=2
            if flag==2:
                R[x]=1
                R[y]=1
                ans+=1
    else:
        if (B[i]-A[i]) in D:
            if not(D[B[i]-A[i]].empty()):
                it=D[A[i]].get()
                j=D[B[i]-A[i]].get()
                R[i]=1
                R[j]=1
                ans+=1
print(ans)



### FIXED CODE ###

N=int(input())
A=sorted([int(i) for i in input().split()],reverse=True)
B=[2**(len(bin(i))-2) for i in A]
D=dict()
for i in range(N):
    if not(A[i] in D):
        D[A[i]]=1
    else:
        D[A[i]]+=1
ans=0
for i in range(N):
    if D[A[i]]<=0:
        continue
    if B[i]==2*A[i]:
        if D[A[i]]>=2:
            D[A[i]]-=2
            ans+=1
    else:
        if (B[i]-A[i]) in D:
            if D[B[i]-A[i]]!=0:
                D[A[i]]-=1
                D[B[i]-A[i]]-=1
                ans+=1
print(ans)
### BUGGY CODE ###

from numpy import array, zeros
IN_RANGE = 5


# 入力受け取り
N = int(input())
a_e = array([int(input()) for i in range(IN_RANGE)])


# どこに人がいるか
a_e_num = zeros(IN_RANGE+1)
a_e_num[0] = N


# 1分ずつの処理
minute = 0
while a_e_num[IN_RANGE] < N:
    minute += 1
    move_index = (a_e_num[:IN_RANGE] - a_e) >= 0
    move_num = a_e_num[:IN_RANGE].copy()
    move_num[move_index] = a_e[move_index]
    a_e_num[:IN_RANGE] = a_e_num[:IN_RANGE] - move_num
    a_e_num[1:] = a_e_num[1:] + move_num

print(minute)

### FIXED CODE ###

# 2019/04/07

from numpy import array, zeros
IN_RANGE = 5


# 入力受け取り
N = int(input())
a_e = array([int(input()) for i in range(IN_RANGE)])


minute = 4 + -(- N // a_e.min())
print(minute)
### BUGGY CODE ###

l = list()
for _ in range(int(input())):
    c = input()
    if c in l:
        pass
    else:
        l.append(c)
print(len(l))

### FIXED CODE ###

l = set()
for _ in range(int(input())):
    l.add(input())
print(len(l))
### BUGGY CODE ###

def gcd(a, b):
  while b:
    a, b = b, a % b
  return a

def lcm(a, b):
  return a * b // gcd (a, b)

A,B,C,D=map(int, input().split())
CD = lcm(C, D)

c_first = 0
c_last = 0
d_first = 0
d_last = 0
cd_first = 0
cd_last = 0

for i in range(A,B+1,1):
  if c_first == 0 and i % C == 0:
    c_first = i // C
  if d_first == 0 and i % D == 0:
    d_first = i // D
  if cd_first == 0 and i % CD == 0:
    cd_first = i // CD  
  if c_first != 0 and d_first != 0 and cd_first != 0:
    break

for i in range(B,A-1,-1):
  if c_last == 0 and i % C == 0:
    c_last = i // C
  if d_last == 0 and i % D == 0:
    d_last = i // D
  if cd_last == 0 and i % CD == 0:
    cd_last = i // CD
  if c_last != 0 and d_last != 0 and cd_last != 0:
    break

c_count = 0
d_count = 0
cd_count = 0
if c_first != 0:
  c_count = c_last - c_first + 1
if d_first != 0:
  d_count = d_last - d_first + 1
if cd_first != 0:
  cd_count = cd_last - cd_first + 1
    
#print(c_first, c_last, d_first, d_last, cd_first, cd_last)
#print(c_count, d_count, cd_count)
print(B - A + 1 - (c_count + d_count - cd_count))



### FIXED CODE ###

def gcd(a, b):
  while b:
    a, b = b, a % b
  return a

def lcm(a, b):
  return a * b // gcd (a, b)

A,B,C,D=map(int, input().split())
CD = lcm(C, D)

c_first = 0
c_last = 0
d_first = 0
d_last = 0
cd_first = 0
cd_last = 0

c_first = (A-1) // C
c_last = B // C
d_first = (A-1) // D
d_last = B // D
cd_first = (A-1) // CD
cd_last = B // CD

c_count = 0
d_count = 0
cd_count = 0
if c_last != 0:
  c_count = c_last - c_first
if d_last != 0:
  d_count = d_last - d_first
if cd_last != 0:
  cd_count = cd_last - cd_first
    
#print(c_first, c_last, d_first, d_last, cd_first, cd_last)
#print(c_count, d_count, cd_count)
print(B - A + 1 - (c_count + d_count - cd_count))
### BUGGY CODE ###

N, M = map(int, input().split())
p = []
S = []
for i in range(M):
  n, a = input().split()
  p.append(int(n))
  S.append(a)

Counted = []
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  if S[j] == "AC" and not p[j] in Counted:
    num1 += 1
    num2 += subnum2[p[j] - 1]
    Counted.append(p[j])
  elif S[j] == "WA" and not p[j] in Counted:
    subnum2[p[j] - 1] += 1
print("{} {}".format(num1, num2))

### FIXED CODE ###

N, M = map(int, input().split())
Counted = [0 for _ in range(N)]
num1 = 0
num2 = 0
subnum2 = [0 for l in range(N)]
for j in range(M):
  p, S = input().split()
  p_ = int(p)
  if S == "AC" and Counted[p_ -1] == 0:
    num1 += 1
    num2 += subnum2[p_ - 1]
    Counted[p_ -1] = 1
  elif S == "WA" and Counted[p_-1] == 0:
    subnum2[p_ - 1] += 1
print("{} {}".format(num1, num2))
### BUGGY CODE ###

import sys
from collections import deque

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


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

    def bfs(v):
        q = deque()
        q.append(v)
        while q:
            u = q.popleft()
            for nv, d in tree[u]:
                if d == 1:
                    dist[nv] = max(dist[nv], dist[u] + d)
                    q.append(nv)

    dist = [0 for _ in range(n)]
    for i in range(n):
        if dist[i] == 0:
            bfs(i)

    print(max(dist))


if __name__ == '__main__':
    resolve()


### FIXED CODE ###

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


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

    # 各頂点の次数
    deg = [0 for _ in range(n)]
    # グラフ
    edge = [[] for _ in range(n)]
    for _ in range(m):
        a, b = map(int, input().split())
        edge[a - 1].append(b - 1)
        deg[b - 1] += 1

    que = deque([])
    for i in range(n):
        if deg[i] == 0:
            que.append(i)

    dp = [0 for _ in range(n)]
    while que:
        v = que.popleft()
        for nv in edge[v]:
            deg[nv] -= 1
            if deg[nv] == 0:
                que.append(nv)
                dp[nv] = max(dp[nv], dp[v] + 1)

    res = 0
    for j in range(n):
        res = max(res, dp[j])
    print(res)


if __name__ == '__main__':
    resolve()
### BUGGY CODE ###

import functools
import operator

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

result = 0
for i, _ in enumerate(A):
    factors = set()
    for j, a in enumerate(A):
        if i == j:
            continue
        factors_a = set()
        for n in range(1, a+1):
            if a%n == 0:
                factors_a.add(n)
                a /= n
        if len(factors) == 0:
            factors = factors_a
        else:
            factors &= factors_a
    if len(factors) > 0:
        result = max(result, functools.reduce(operator.mul, factors))

print(result)


### FIXED CODE ###

from fractions import gcd
from sys import exit

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

l_gcd_list = [0]
r_gcd_list = [0]
for i in range(N):
    l_gcd_list.append(gcd(l_gcd_list[i], A[i]))
    r_gcd_list.append(gcd(r_gcd_list[i], A[-(i+1)]))
r_gcd_list = r_gcd_list[::-1]
# print(l_gcd_list)
# print(r_gcd_list)

results = []
for i in range(N):
    results.append(gcd(l_gcd_list[i], r_gcd_list[i+1]))

print(max(results))
### BUGGY CODE ###

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

a.sort()
for t in range(m):
  discount = a.pop() / 2.
  inserted = False
  for i in range(n - 1):
    if a[i] > discount:
      a.insert(i, discount)
      inserted = True
      break
  if not inserted:
    a.append(discount)
    
print(sum(map(int, a)))

### FIXED CODE ###

import heapq

n, m = list(map(int, input().split()))
a = list(map(lambda x: -float(x), input().split()))

heapq.heapify(a)
for t in range(m):
  discount = heapq.heappop(a) / 2.
  heapq.heappush(a, discount)
    
print(sum(map(lambda x: int(-x), a)))
### BUGGY CODE ###

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

m = int(n/2)-1
for i in range(n):
    x_tmp = x[:i] + x[i+1:]
    x_tmp.sort()
    print(x_tmp[m])


### FIXED CODE ###

from heapq import heappush, heappop

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

m = int(n/2)-1
x_tmp = sorted(x)

for i in range(n):
    if x[i] <= x_tmp[m]:
        print(x_tmp[m+1])
    else:
        print(x_tmp[m])
### BUGGY CODE ###

I = lambda n: [int(input()) for _ in range(n)]
f = lambda S, x: min(S, key = lambda s: abs(x-s))
g = lambda x, s, t: abs(x-s)+abs(s-t)
a, b, q = map(int, input().split())
S, T, X = I(a), I(b), I(q)
for x in X:
    s, t = f(S, x), f(T, x)
    print(min(g(x, s, f(T, s)), g(x, t, f(S, t))))

### FIXED CODE ###

import bisect
from itertools import product
I = lambda n: [int(input()) for _ in range(n)]
def f(S, x):
    p = bisect.bisect_left(S, x)
    return [S[p-1], S[p]]
g = lambda x, s, t: abs(x-s)+abs(s-t)
INF = 10**11
a, b, q = map(int, input().split())
S, T, X = [-INF]+I(a)+[INF], [-INF]+I(b)+[INF], I(q)
for x in X:
    min_ = INF
    for s, t in product(f(S, x), f(T, x)):
        min_ = min(min_, g(x, s, t), g(x, t, s))
    print(min_)
### BUGGY CODE ###

import bisect

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

m = (n-1) // 2
 
x_sorted = sorted(x)

ans = []

for i in range(n):
    ind = bisect.bisect_left(x_sorted, x[i])
    ans.append(x_sorted[0:ind] + x_sorted[ind+1:])

for i in range(n):
    print(ans[i][m])

### FIXED CODE ###

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

sorted_x = sorted(x)
l = sorted_x[n//2]
s = sorted_x[n//2-1]

for i in x:
    if i <= s:
        print(l)
    else:
        print(s)