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

N = int(input())
A = [int(x) for x in input().split()]
total_medians = N*(N+1)//2
# n件のデータ
# (上側中央値 >= x) iff (a > x となる a が(n-1)//2以下)

def BIT_update(BIT,x,value):
  # 番号xにvalueを加える
  L = len(BIT)
  while x < L:
    BIT[x] += value
    bottom_bit = x & (-x)
    x += bottom_bit
  return

def BIT_sum(BIT,x):
  # 番号1～xの和を求める
  result = 0
  while x:
    result += BIT[x]
    bottom_bit = x & (-x)
    x -= bottom_bit
  return result

def test(x):
  # 「答はx以下である」
  # 「xより真に大きな区間中央値が(total_medians-1)//2個以下」
  B = [0]
  for a in A:
    B.append(B[-1] + (1 if a>x else -1))
  m = min(B)-1
  B = [x-m for x in B]

  BIT = [0]*(N+1)
  
  cnt = 0
  for R in range(1,N+1):
    BIT_update(BIT,B[R-1],1)
    cnt += BIT_sum(BIT,B[R]) # 右端がRとなる(L,R)対
  return cnt <= (total_medians-1)//2

AA = sorted(A)
left = -1 # 答はAA[left]より大きい
right = len(AA)-1 # 答はAA[right]以下である
while right - left > 1:
  mid = (left+right)//2
  if test(AA[mid]):
    right = mid
  else:
    left = mid
answer = AA[right]

print(answer)


### FIXED CODE ###

N = int(input())
A = [int(x) for x in input().split()]
total_medians = N*(N+1)//2
# n件のデータ
# (上側中央値 >= x) iff (a > x となる a が(n-1)//2以下)

def BIT_update(BIT,x,value):
  # 番号xにvalueを加える
  L = len(BIT)
  while x < L:
    BIT[x] += value
    bottom_bit = x & (-x)
    x += bottom_bit
  return

def BIT_sum(BIT,x):
  # 番号1～xの和を求める
  result = 0
  while x:
    result += BIT[x]
    bottom_bit = x & (-x)
    x -= bottom_bit
  return result

def test(x):
  # 「答はx以下である」
  # 「xより真に大きな区間中央値が(total_medians-1)//2個以下」
  B = [0]
  for a in A:
    B.append(B[-1] + (1 if a>x else -1))
  m = min(B)-1
  B = [x-m for x in B]

  BIT = [0]*(N+1)
  
  cnt = 0
  for R in range(1,N+1):
    BIT_update(BIT,B[R-1],1)
    cnt += BIT_sum(BIT,B[R]) # 右端がRとなる(L,R)対
  return cnt <= (total_medians-1)//2

AA = sorted(A)
left = -1 # 答はAA[left]より大きい
right = len(AA)-1 # 答はAA[right]以下である
while right - left > 1:
  mid = (left+right)//2
  if test(AA[mid]):
    right = mid
  else:
    left = mid
answer = AA[right]

print(answer)
### BUGGY CODE ###

N, M = [int(i) for i in input().strip().split(' ')]
A = [int(i) for i in input().strip().split(' ')]
A = sorted(A)
for _ in range(M):
  b, c = [int(i) for i in input().strip().split(' ')]
  for i in range(b):
    if A[i] > c:
      break
    A[i] = c
  A = sorted(A)

print(sum(A))

### FIXED CODE ###

from operator import itemgetter

N, M = [int(i) for i in input().strip().split(' ')]
A = [int(i) for i in input().strip().split(' ')]
A = sorted(A, reverse=True)

X = []
for _ in range(M):
  (b, c) = [int(i) for i in input().strip().split(' ')]
  X.append((b, c))

X = sorted(X, reverse=True, key=itemgetter(1))
if M < N:
  for _ in range(N - M):
    X.append((0, 0))

v = 0
ai = 0
xi = 0

while N > 0:
  a = A[ai]
  n, x = X[xi]
  if a > x:
    N -= 1
    ai += 1
    v += a
  else:
    if n > N:
      n = N
    N -= n
    xi += 1
    v += x * n

print(v)
### BUGGY CODE ###

N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
for num,a in enumerate(A):
    del A[num]
    print(max(A))
    A.insert(num,a)


### FIXED CODE ###

A = [int(input()) for i in range(int(input()))]
first = max(A)
second = sorted(A)[-2]
for i in A:
    if i == first:
        print(second)
    else:
        print(first)
### BUGGY CODE ###

n = int(input())
s = input()
r = []
g = []
b = []
for i in range(n):
    if s[i] == "R":
        r.append(i)
    elif s[i] == "G":
        g.append(i)
    elif s[i] == "B":
        b.append(i)
total = len(r) * len(g) * len(b)
subs = 0
for l in range(len(r)):
    for m in range(len(g)):
        for n in range(len(b)):
            nums = [r[l], g[m], b[n]]
            nums.sort()
            if nums[2] - nums[1] == nums[1] - nums[0]:
                subs += 1
            else:
                continue
ans = total - subs
print(ans)


### FIXED CODE ###

n = int(input())
s = input()
r = 0
g = 0
b = 0
for letter in s:
    if letter == "R":
        r +=1
    elif letter == "G":
        g +=1
    elif letter == "B":
        b +=1
total = r * g * b
subs = 0
for i in range(n):
    for j in range(i + 1, n):
        k = 2 * j - i
        if k <= n - 1:
            if s[i] == s[j]:
                continue
            elif s[j] == s[k]:
                continue
            elif s[k] == s[i]:
                continue
            else:
                subs += 1
        else:
            break
ans = total - subs
print(ans)
### BUGGY CODE ###

import numpy as np
import itertools

n = int(input())

route = [np.array(list(map(int, input().split()))) for _ in range(n)]
results = []
for v in itertools.permutations(route, r=n):
    distance = 0
    for start, goal in zip(v[:-1], v[1:]):
        distance += np.linalg.norm(goal - start)
    results.append(distance)
print(np.mean(results))


### FIXED CODE ###

import itertools

n = int(input())

route = [list(map(int, input().split())) for _ in range(n)]
results = []
for v in itertools.permutations(route, r=n):
    distance = 0
    for i in range(n - 1):
        start, goal = v[i], v[i + 1]
        distance += ((goal[0] - start[0]) ** 2 + (goal[1] - start[1]) ** 2) ** 0.5
    results.append(distance)
print(sum(results) / len(results))
### BUGGY CODE ###

from collections import Counter

n = int(input())
ball = [int(i) for i in input().split()]
for i in range(n):
  counter = Counter(ball[:i]+ball[i+1:])
  result = 0
  print(sum([i * (i - 1) // 2 for i in counter.values()]))
  

### FIXED CODE ###

from collections import Counter

n = int(input())
ball = [int(i) for i in input().split()]
counter = Counter(ball)
result = sum([i * (i - 1) // 2 for i in counter.values()])

for i in range(n):
  c = counter[ball[i]]
  print(result - (c - 1))
### BUGGY CODE ###

import heapq
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(n+1):
  m=0
  b1=a[:n+i]
  b2=a[n+i:]
  heapq.heapify(b1)
  heapq.heapify(b2)
  for j in range(i):
    b=heapq.heappop(b1)
  for j in range(n):
    b=heapq.heappop(b2)
    m-=b
  m+=sum(b1)
  if ans<m or i==0:
    ans=m
print(ans)

### FIXED CODE ###

import heapq
n=int(input())
a=list(map(int,input().split()))
ans=[0 for i in range(n+1)]
ans[0]=sum(a[:n])
b=a[:n]
heapq.heapify(b)
sb=sum(b)
for i in range(n):
  sb+=a[n+i]
  c=heapq.heappushpop(b,a[n+i])
  sb-=c
  ans[i+1]=sb
b=a[2*n:]
for i in range(n):
  b[i]=-b[i]
heapq.heapify(b)
ans[n]+=sum(b)
sb=sum(b)
for i in range(n-1,-1,-1):
  sb-=a[n+i]
  c=heapq.heappushpop(b,-a[n+i])
  sb-=c
  ans[i]+=sb
print(max(ans))
### BUGGY CODE ###

def q3():
    N = int(input())
    P = [int(i) for i in input().split()]
    ans = 0
    for i in range(N):
        m = min(P[:i+1])
        if P[i] == m:
            ans += 1
    print(ans)

    
if __name__ == '__main__':
    q3()


### FIXED CODE ###

def q3():
    N = int(input())
    P = [int(i) for i in input().split()]
    ans = 0
    min_p = P[0]
    for i in range(N):
        if P[i] <= min_p:
            min_p = P[i]
            ans += 1
    print(ans)


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

#!/usr/bin/env python3
import sys

def solve(N: int, M: int, A: "List[int]"):
    
    A = sorted(A,reverse=True)
    while True:
        A[0] = A[0] // 2
        M -= 1
        if M == 0:
            break
        if N == 1:
            continue

        for i in range(N-1):
            if i == M:
                break
            if A[i] < A[i+1]:
                tmp = A[i+1]
                A[i+1] = A[i]
                A[i] = tmp
            else:
                break
    print(sum(A))

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, M, A)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
import heapq

def solve(N: int, M: int, A: "List[int]"):

    while True:
        tmp = heapq.heappop(A) * -1
        heapq.heappush(A,tmp // 2 * -1)
        M -= 1
        if M == 0:
            break
    
    print(sum(A) * -1)

def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = []
    heapq.heapify(A)
    for i in range(N):
        heapq.heappush(A,int(next(tokens)) * -1)

    solve(N, M, A)

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

import numpy as np

num_of_numbers = int(input())
numbers = np.array(list(map(int, input().split())))
num_of_operation = int(input())
operations = []
for i in range(num_of_operation):
    operations.append(list(map(int, input().split())))

for operation in operations:
    numbers = np.where(numbers == operation[0], operation[1], numbers)
    print(sum(numbers))

### FIXED CODE ###

import collections

num_of_numbers = int(input())
numbers = list(map(int, input().split()))
num_of_operation = int(input())

# intで初期化するため0が返る
cnt = collections.defaultdict(int)
# numbersに含まれる各数字の出現回数を保持
for i in numbers:
    cnt[i] += 1

# 初期状態の和を算出
ans = sum(numbers)

for i in range(num_of_operation):
    B, C = map(int, input().split())

    # 置換対象の数字が存在する場合
    if B in cnt:
        tmpB = cnt[B]
        tmpC = cnt[C]
        ans = ans - (B * tmpB) + (C * tmpB)

        cnt[C] = tmpC + tmpB
        cnt.pop(B)

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

# coding: utf-8

n, k = map(int, input().rstrip().split())    # 2 <= n <= 10^5, 1 <= k <= 100
h = list(map(int, input().rstrip().split()))

dp = [0] * 100010
dp[0] = 0
for i in range(1, n):
    dp[i] = min(dp[j] + abs(h[i] - h[j]) \
        for j in range(max(i - k, 0), i))
print(dp[i])


### FIXED CODE ###

# coding: utf-8

def f(n, k, h):
    dp = [0 for _ in range(n)]
    for i in range(1, n):
        js = max(i - k, 0)
        dp[i] = min(dp[j] + abs(h[i] - h[j]) \
            for j in range(js, i))
        # print(dp)
    return(dp[i])

n, k = map(int, input().rstrip().split())    # 2 <= n <= 10^5, 1 <= k <= 100
h = list(map(int, input().rstrip().split()))

print(f(n, k, h))
### BUGGY CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(n):
    ans *= a[i]
if ans > 10**18:
    print(-1)
else:
    print(ans)

### FIXED CODE ###

n = int(input())
a = list(map(int, input().split()))
ans = 1
flag = True
if 0 in a:
    print(0)
else:
    for i in range(n):
        ans *= a[i]
        if ans > 10**18:
            flag = False
            print(-1)
            break
    if flag:
        print(ans)
### BUGGY CODE ###

n, k = map(int, input().split())
h = [int(i) - 1 for i in input().split()]
d = [float('inf')] * n
d[0] = 0
for i in range(1, n):
    costs = []
    for j in range(1, k + 1):
        if i - j >= 0:
            costs.append(d[i - j] + abs(h[i] - h[i - j]))
    d[i] = min(d[i], min(costs))
print(d[-1])

### FIXED CODE ###

n, k = map(int, input().split())
h = [int(i) - 1 for i in input().split()]
d = [float('inf')] * n
d[0] = 0
for i in range(1, n):
    costs = []
    for j in range(1, k + 1):
        if i - j >= 0:
            costs.append(d[i - j] + abs(h[i] - h[i - j]))
    d[i] = min(d[i], min(costs))
print(d[-1])
### BUGGY CODE ###

s = input()
n = len(s)


cnt = 0

idx01 = s.find('01')
idx10 = s.find('10')

while idx01 != -1 or idx10 != -1:
    if idx01 == -1 and idx10 == -1:
        print(cnt)
        exit()
    if idx01 == -1:
        idx01 = 1000000
    if idx10 == -1:
        idx10 = 1000000
    if idx01 <= idx10:
        s = s.replace('01', '', 1)
    else:
        s = s.replace('10', '', 1)
    cnt += 1
    idx01 = s.find('01')
    idx10 = s.find('10')

print(cnt * 2)


### FIXED CODE ###

s = input()
n = len(s)
cnt = []
cnt.append(s.count('0'))
cnt.append(s.count('1'))

print(2 * min(cnt))
### BUGGY CODE ###

from copy import deepcopy
k = int(input())

lun = []
for i in range(1,10):
    lun.append(i)

if k <= 9:
    print(lun[k-1])
    exit()

prev_lun = deepcopy(lun)
while True:
    for pl in prev_lun:
        for i in [-1, 0, 1]:
            d = pl%10 + i
            if not 0 <= d <= 9:
                continue
            lun.append(pl*10 + d)
            if len(lun) == k:
                print(lun[k-1])
                exit()
                
    prev_lun = []


### FIXED CODE ###

from copy import deepcopy
k = int(input())

lun = []
for i in range(1,10):
    lun.append(i)

if k <= 9:
    print(lun[k-1])
    exit()

prev_lun = deepcopy(lun)

while True:
    size = len(lun)
    for pl in prev_lun:
        for i in [-1, 0, 1]:
            d = pl%10 + i
            if 0 <= d <= 9:
                lun.append(pl*10 + d)
            if len(lun) == k:
                # print(lun)
                print(lun[k-1])
                exit()
                
    prev_lun = deepcopy(lun[size:])
### BUGGY CODE ###

def inpl(): return list(map(int, input().split()))

MOD = 10**9 + 7
S = input()[::-1]
x = 1

DP = [0]*13
DP[0] = 1
for i in range(len(S)):
    DP2 = [0]*13
    if S[i] != "?":
        s = int(S[i])
        for i in range(13):
            DP2[(i + s*x)%13] = DP[i]%MOD
    else:
        for j in range(10):
            for i in range(13):
                DP2[(i + j*x)%13] = (DP2[(i + j*x)%13] + DP[i])%MOD
    x *= 10
    DP = DP2

print(DP[5]%MOD)

### FIXED CODE ###

def inpl(): return list(map(int, input().split()))

MOD = 10**9 + 7
S = input()[::-1]
x = 1

DP = [0]*13
DP[0] = 1
for i in range(len(S)):
    DP2 = [0]*13
    if S[i] != "?":
        s = int(S[i])
        for i in range(13):
            DP2[(i + s*x)%13] = DP[i]%MOD
    else:
        for j in range(10):
            for i in range(13):
                DP2[(i + j*x)%13] = (DP2[(i + j*x)%13] + DP[i])%MOD
    x = x*10%13
    DP = DP2

print(DP[5]%MOD)
### BUGGY CODE ###

import numpy as np
N,M = list(map(int,input().split()))
A = input().split()

count = 0
A = np.array(A,dtype='int64')
B = np.cumsum(A)
C = np.append([0],B)

L = (1 for i in range(len(A)+1) for t in range(len(A)+1) if i<t and (C[t] - C[i])%M==0)
print(len(list(L)))

### FIXED CODE ###

import collections
import numpy as np

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

A = np.array(A,dtype='int64')
C = np.append([0],np.cumsum(A))
L = [i%M for i in C]
L_c = collections.Counter(L)

ans = 0
for i in L_c.values():
    S = i * (i-1) / 2
    ans+=S
    
print(int(ans))
### BUGGY CODE ###

A, B, C = map(int, input().split())
count = 0

def dfs(a, b, c, count):
    if a == b == c:
        return count
    elif a > 51 or b > 51 or c > 51:
        return 1000
    count = min(dfs(a+1, b+1, c, count+1), dfs(a, b+1, c+1, count+1),\
            dfs(a+1, b, c+1, count+1), dfs(a+2, b, c, count+1),      \
            dfs(a, b+2, c, count+1), dfs(a, b, c+2, count+1))

    return count

count = dfs(A, B, C, count)

print(count)


### FIXED CODE ###

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

X = max(A, B, C)
K = A + B + C

if (3*X - K) % 2:
    print((3*(X+1) - K) // 2)
else:
    print((3*X - K) // 2)
### BUGGY CODE ###

N = int(input())
 
A = list(input().split())
 
for i in range(1,N+1):
  print(A.count(str(i)))

### FIXED CODE ###

N = int(input())
 
A = list(map(int, input().split()))
 
result = [0]*N
for i in A:
  result[i-1] +=1
  
for j in result:
  print(j)
### BUGGY CODE ###

import sys
 
n,m = map(int,input().split())
a_arr = []
b_arr = []
c_arr = []
 
dic_arr = [{i:sys.maxsize for i in range(2 ** n)}]
dic_arr[0][0] = 0
 
for i in range(m):
  a,b = map(int,input().split())
  a_arr.append(a)
  b_arr.append(b)
  tmp_arr = list(map(int, input().split()))
  
  arr = []
  for j in range(1, n+1):
    if j in tmp_arr:
      arr.append('1')
    else:
      arr.append('0')
  
  c = int(''.join(arr),2)
  
  dic_arr.append(dic_arr[i].copy())
  
  for k in dic_arr[i].keys():
    dic_arr[i+1][k|c] = min(dic_arr[i+1][k|c],a+dic_arr[i][k])  
 
if dic_arr[m][(2**n)-1] != sys.maxsize:
  print(dic_arr[m][(2**n) -1])
else:
  print(-1)

### FIXED CODE ###

n,m = map(int,input().split())
 
dic = {0:0}
 
for i in range(m):
  a,b = map(int,input().split())
  tmp_arr = list(map(int, input().split()))
  
  arr = []
  for j in range(1, n+1):
    if j in tmp_arr:
      arr.append('1')
    else:
      arr.append('0')
  
  c = int(''.join(arr),2)
  
  dic2 = dic.copy()
  
  for k,v in dic.items():
    if (k|c) in dic2.keys():
      dic2[k|c] = min(dic2[k|c],a+v)
    else:
      dic2[k|c] = a+v
 
  dic = dic2
 
if ((2**n)-1) in dic.keys():
  print(dic[(2**n) -1])
else:
  print(-1)
### BUGGY CODE ###

import sys
sys.setrecursionlimit(200005)
n, q = map(int, input().split())

to = [[] for i in range(n+1)]


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

score = [0]*(n+1)

for i in range(q):
    p, x = map(int, input().split())
    score[p] += x


def down_tree(index, parent=-1):
    global score
    if parent != -1:
        score[index] += score[parent]
    for i in to[index]:
        if i == parent:
            continue
        down_tree(i, index)
    return


down_tree(1)

print(*score[1:])

### FIXED CODE ###

import sys
input = sys.stdin.readline
sys.setrecursionlimit(200005)
n, q = map(int, input().split())

to = [[] for i in range(n+1)]


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

score = [0]*(n+1)
for i in range(q):
    p, x = map(int, input().split())
    score[p] += x


def down_tree(index, parent):
    for i in to[index]:
        if i == parent:
            continue
        score[i] += score[index]
        down_tree(i, index)



down_tree(1, 1)

print(' '.join(map(str, score[1:])))
### BUGGY CODE ###

import math
K=int(input())
N=[i for i in range(K*K*K)]
j=0
for a in range(K):
    for b in range(K):
        for c in range(K):
            N[j]=math.gcd(math.gcd((c+1),(b+1)),(a+1))
            j+=1
print(sum(N))

### FIXED CODE ###

import math
K=int(input())
N=0
k=K*K
d1=[0]*int(k)
i=0
j=0
for b in range(K):
    for c in range(K):
        d1[i]=math.gcd((c+1),(b+1))
        i+=1
for a in range(K):
    for x in d1:
        N+=math.gcd(x,(a+1))
print(N)
### BUGGY CODE ###

n, m, k = input().split()
a = input().split()
b = input().split()

n = int(n)
m = int(m)
k = int(k)
a = list(map(int, a))
b = list(map(int, b))

ans = 0
temp_a = {}
temp_b = {}

for i_a in range(n+1):
  if sum(a[0:i_a]) > k:
    break
  temp_a[i_a] = sum(a[0:i_a])
for i_b in range(m+1):
  if sum(b[0:i_b]) > k:
    break
  temp_b[i_b] = sum(b[0:i_b])
  
temp_a = sorted(temp_a.items(), key=lambda x:x[1], reverse=True)
temp_b = sorted(temp_b.items(), key=lambda x:x[1], reverse=True)
ans = {}

if len(temp_a) > len(temp_b):
  temp_a, temp_b = temp_b, temp_a
  n, m = m, n

for item_a in temp_a:
  for item_b in temp_b:
    if item_a[1] + item_b[1] > k:
      continue
    else:
      ans[len(ans)] = item_a[0] + item_b[0]
      break

ans = max(ans.values())
print(ans)


### FIXED CODE ###

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

a, b = [0], [0]

for i in range(n):
  a.append(a[i] + A[i])
  
for i in range(m):
  b.append(b[i] + B[i])
  
ans, j = 0, m

for i in range(n+1):
  if a[i] > k:
    break
  while a[i] + b[j] > k:
    j -= 1
  ans = max(ans, i+j)

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

from sys import stdin, setrecursionlimit
from functools import lru_cache
input = stdin.readline

setrecursionlimit(200000)
n = int(input())
c = [0] * 4
l = list(map(int, input().split()))

for i in l:
    c[i] += 1


# dp = []
@lru_cache(None)
def dp(n3, n2, n1, n0):
    if n0 == n:
        return 0
    else:
        ans = n
        if n3 > 0:
            ans += n3 * dp(n3 - 1, n2 + 1, n1, n0)
        if n2 > 0:
            ans += n2 * dp(n3, n2 - 1, n1 + 1, n0)
        if n1 > 0:
            ans += n1 * dp(n3, n2, n1 - 1, n0 + 1)
        ans /= n - n0
        return ans


print(dp(*c[::-1]))

### FIXED CODE ###

"""
https://atcoder.jp/contests/dp/tasks/dp_j
"""
from sys import stdin
input = stdin.readline

n = int(input())
c = [0] * 4
l = list(map(int, input().split()))

for i in l:
    c[i] += 1

dp = [[[0.0] * (n + 1) for i in range(n + 1)] for j in range(n + 1)]
dp[0][0][0] = 0
for n3 in range(0, c[3] + 1):
    for n2 in range(0, c[2] + c[3] - n3 + 1):
        for n1 in range(0, n-c[0]- n3 - n2 + 1):
            if n1 == n2 == n3 == 0:
                continue
            temp = n
            if n1 != 0:
                # temp += n1 * dp[(n1 - 1, n2, n3)]
                temp += n1*dp[n1 - 1][n2][n3]
            if n2 != 0:
                # temp += n2 * dp[(n1 + 1, n2 - 1, n3)]
                temp += n2*dp[n1 + 1][n2 - 1][n3]
            if n3 != 0:
                # temp += n3 * dp[(n1, n2 + 1, n3 - 1)]
                temp += n3*dp[n1][n2 + 1][n3 - 1]
            dp[n1][n2][n3] = temp / (n1 + n2 + n3)

print(dp[c[1]][c[2]][c[3]])
### BUGGY CODE ###

n = int(input())
x = [int(i) for i in input().split()]
for i in range(n):
    y = x.copy()
    del y[i]
    y.sort()
    print(y[n//2 - 1])

### FIXED CODE ###

n = int(input())
x = [int(i) for i in input().split()]
y = x.copy()
y.sort()
y_e = y[n//2]
y_o = y[n//2 - 1]
for xx in x:
    if xx >= y_e:
        print(y_o)
    else:
        print(y_e)
### BUGGY CODE ###

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

e = [0] * N

for i in range(N):
    e[i] = (p[i] + 1) / 2

ans = 0

for i in range(N - K + 1):
    total = sum(e[i:i + K])
    if total > ans:
        ans = total

print(ans)


### FIXED CODE ###

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

e = [0] * N

for i in range(N):
    e[i] = (p[i] + 1) / 2

total = sum(e[0:K])
ans = total

for i in range(N - K):
    total += e[i + K] - e[i]
    if total > ans:
        ans = total

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

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

for _ in range(m):
    b,c = map(int, input().split())
    if min(a) < c:
        for _ in range(b):
            if min(a) < c:
                a[a.index(min(a))] = c
            else:
                break

print(sum(a))

### FIXED CODE ###

n,m = map(int, input().split())
a = sorted(list(map(int,input().split())))
bc = [list(map(int, input().split())) for _ in range(m)]
bc.sort(key=lambda x: x[1], reverse=True )
count = 0
for b,c in bc:
    for _ in range(b):
        if count == n or a[count] >= c:
            break

        a[count] = c
        count += 1

print(sum(a))
### BUGGY CODE ###

n,k=map(int,input().split())
al=list(map(int,input().split()))
b=1
for v in al[:k]:
    b*=v
for i in range(k,n):
    c=1
    for v in al[i-k+1:i+1]:
        c*=v
    print('Yes'if b<c else 'No')
    b=c


### FIXED CODE ###

n,k=map(int,input().split())
al=list(map(int,input().split()))
for b,c in zip(al,al[k:]):
    print('Yes'if b<c else'No')