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

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




ans = float(0)
final = 0
repeat = N-K+1
for j in range(repeat):
    ans = 0
    for i in range(K):
        ans = ans+P[i+j]*0.5+0.5
        if final <= ans :
            final = ans
        
print(final)

### FIXED CODE ###

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

wa = float(0)
for i in range(K):
    wa = wa + P[i]

ans = wa 
  
repeat = N-K
for i in range(repeat):
    wa = wa + P[i+K]-P[i]
    if ans <= wa :
        ans = wa
      
print(ans/2+(K*0.5))
### BUGGY CODE ###

n = int(input())
l = list(map(int ,input().split(" ")))
count = 0
while True:
  for i in range(n):
    if l[i]%2 == 0:
      l[i] = l[i]//2
    else:
      print(count)
      break
  count += 1

### FIXED CODE ###

n = int(input())
l=list(map(int,input().split()))
count=0
while True:
    for i in range(n):
        if l[i]%2==0:
            l[i]=l[i]//2
        else:
            print(count)
            exit()
    count+=1
### BUGGY CODE ###

import itertools
N,M = [int(i) for i in input().split(' ')]

x = []

for i in range(N):
    x.append([int(i) for i in input().split(' ')])

ans = 0
p = list(itertools.permutations(x,M));
for i in p:
    A=0
    B =0
    C=0
    for j in range(M):
        A += i[j][0]
        B += i[j][1]
        C += i[j][2]
    if A<0:
        A = -A
    if B<0:
        B = -B
    if C<0:
        C = -C
    a = A+B+C
    if a > ans:
        ans = a

#print(p)
print(ans)
   


### FIXED CODE ###

import itertools
N,M = [int(i) for i in input().split(' ')]

x = []

for i in range(N):
    x.append([int(i) for i in input().split(' ')])
tab = [0]*N
ans = 0
#p = list(itertools.permutations(x,M));
for S in [[1,1,1],[1,1,-1],[1,-1,1],[1,-1,-1],[-1,1,1],[-1,1,-1],[-1,-1,1],[-1,-1,-1]]:
    for j in range(N):
        a = 0
        a += x[j][0]*S[0]
        a += x[j][1]*S[1]
        a += x[j][2]*S[2]
        tab[j] = a
    tab.sort()
#    print(tab)
    a =0
    for j in range(M):
        a += tab[N-j-1]
 #   print(a)
    if a > ans:
        ans = a

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

import numpy as np
import sys
input = sys.stdin.readline
N, K = map(int, input().split())
hh = input().split()
h = np.array([int(x) for x in hh])
d = np.inf
dp = np.ones(N) * d
dp[0] = 0
cc = np.arange(1, N)
for i in cc:
  j = i - min(i, K)
  dp[i] = min(dp[j:i]+np.abs(h[i]-h[j:i]))
print(int(dp[N-1]))

### FIXED CODE ###

import sys
import numpy as np

# inputを高速化する。
input = sys.stdin.readline

n, k = map(int, input().split())
h = [int(i) for i in input().split()]

# dpの配列を作る。
dp = np.zeros(n, dtype=int)
# hの配列を作る。
h = np.array(h)


for i in range(1, n):
    # start は負になることはない。
    start = max(0, i-k)
    # 行列として足し算できるのでforを使う必要がない。
    dp[i] = min(dp[start: i] + np.abs(h[i] - h[start: i]))

print(dp[n-1])
### BUGGY CODE ###

MOD = 1000000007;

s = input()

n=len(s)

if n<1 or n>10**5:
	print ('Illegal')
	exit()

#a=[-1]*len(s)
#b=np.zeros((n+1, 13), dtype = 'int64')
#p=np.zeros(n,dtype=int)

b=[[0 for i in range(13)] for j in range(n+1)]
#p=[0]*n


p=1
#for i in reversed(range(n)):
#	p[i]=x%13
#	x=p[i]*10
	
for i in range(n):
	ix=n-1-i
	if(s[ix]=="?"):
		c=-1
	else:
		c=int(s[ix])
	if ( i== 0):
		if (c==-1):
			for j in range(10):
				b[0][(p*j)%13]=1
		else:
			b[0][(p*c)%13]=1
	else:
		if (c==-1):
			for j in range(10):
				for k in range(13):
					b[i][(k+p*j)%13]+=b[i-1][k]
		else:
			for k in range(13):
				b[i][(k+p*c)%13]+=b[i-1][k]

	for k in range(13):b[i][k]%=MOD
	p=p*10%13
#	print (b[i])
#	print (b[i+1])

print (b[n-1][5])



### FIXED CODE ###

MOD = 1000000007;

s = [int(x) if x!="?" else -1 for x in input()]

n=len(s)

r=[0]*13

c=s[0]
if (c!=-1):
	r[c]=1
else:
	for i in range(10):r[i]=1

for i in range(1,n):
	dp=[0]*26
	for j in range(13):dp[j*10%13]+=(r[j]%MOD)
	dp[13:26]=dp[0:13]
	c=s[i]
	r=[0]*13
	if (c==-1):
		w=sum(dp[4:14])
		for j in range(13):
				r[j]+=w
				w=w+dp[j+1]-dp[4+j]
	else:
		for j in range(13):
			r[j]+=dp[13-c+j]
print (r[5]%MOD)
### BUGGY CODE ###

counter = [0]*2019
counter[0] = 1 # 0 = 0 (mod 2019)

S = input()
tmp = 0
for i in range(1,len(S)+1):
    tmp += int(S[-i])*10**(i-1)
    #print(tmp%2019)
    counter[tmp%2019] += 1

ans = 0
for i in range(2019):
    if counter[i] >= 2:
        #ans += comb(counter[i], 2, exact=True)
        ans += counter[i]*(counter[i]-1)//2
print(ans)
    

### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Sep  6 23:39:24 2020

@author: liang
"""
#from scipy.special import comb

counter = [0]*2019
counter[0] = 1 # 0 = 0 (mod 2019)

S = input()
tmp = 0
"""
#大きい数を一気に掛けない
for i in range(1,len(S)+1):
    tmp += int(S[-i])*10**(i-1)    #スライスの方が早い（けど、漸化式的に累積和を出せ）
    #print(tmp%2019)
    tmp %= 2019                    #大きい数を割るな
    counter[tmp%2019] += 1

ans = 0
for i in range(2019):
    if counter[i] >= 2:
        #ans += comb(counter[i], 2, exact=True)
        ans += counter[i]*(counter[i]-1)//2
print(ans)
"""
MOD = 2019
#reversed(s) ?
t = 1
for i in range(1,len(S)+1):
    tmp += int(S[-i])*t
    #print("A", tmp)
    tmp %= MOD 
    t *= 10
    #print("B", tmp)
    t %= MOD
    #print(tmp)
    counter[tmp] += 1
    
print(sum(i*(i-1)//2 for i in counter))
### BUGGY CODE ###

N = map(int, input().split())
l = list(map(int, input().split()))
count=0
for i in range(len(l)-1):
    while l[i] >l[i+1]:
        l[i+1]+=1
        count+=1
print(count)

### FIXED CODE ###

N = map(int, input().split())
l = list(map(int, input().split()))
from collections import deque


l = deque(l)

count=0
for i in range(len(l)-1):
    if l[i] >l[i+1]:
        c=l[i] -l[i+1]
        l[i+1]+=c
        count+=c

print(count)
### BUGGY CODE ###

'''
自宅用PCでの解答
'''
import math
#import numpy as np
import itertools
import queue
import bisect
from collections import deque,defaultdict
import heapq as hpq
from sys import stdin,setrecursionlimit
#from scipy.sparse.csgraph import dijkstra
#from scipy.sparse import csr_matrix
ipt = stdin.readline
setrecursionlimit(10**7)

def main():
    n = int(ipt())
#    n = 10**5
    ls_by = [[] for i in range(n+1)]
    for i in range(2,n+1):
        a = int(ipt())
        ls_by[a].append(i)
    def dpt(k):
        st = []
        for i in ls_by[k]:
            st.append(dpt(i)+1)
        st.sort(reverse=True)
        ma = 0
        for i,si in enumerate(st):
            if si+i > ma:
                ma = si+i
        return ma

    print(dpt(1))


    return None

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
import resource
n = int(input())
sys.setrecursionlimit(10**5)

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

for i in range(2,n+1):
    ai = int(input())
    wl[ai].append(i)

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

def calc_dp(a):
    if len(wl[a]) == 0:
        return 0
    else:
        dps = []
        for i in wl[a]:
            dps.append(calc_dp(i))
        dps.sort(reverse=True)
        ma = 0
        for i,dpi in enumerate(dps):
            if ma < dpi+i:
                ma = dpi+i
        return ma+1

print(calc_dp(1))
### BUGGY CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(N - 1):
  for j in range(i+1, N):
    ans += A[i] * A[j]
print(ans % (10 ** 9 + 7))

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
ans = 0
num = sum(A)
for i in range(N - 1):
  num -= A[i]
  ans += A[i] * num
print(ans % (10 ** 9 + 7))
### BUGGY CODE ###

s = input()
cnt=0

for i in range(len(s)//2):
    try: 
        if '10' in s:
            cnt+=2 * s.count('10')
            s=s.replace('10', '') 
    except:
        pass
    try: 
        if '01' in s:
            cnt+=2 * s.count('01')
            s=s.replace('01', '') 
    except:
        pass
print(cnt)

### FIXED CODE ###

#120 C
S =input()
print(min(S.count('0'),S.count('1'))*2)
### BUGGY CODE ###

# coding: utf-8

# https://atcoder.jp/contests/abc088/tasks/abc088_d
# 19:01-20:04 chudan
# 20:17-20:30 done


def main():
    H, W = map(int, input().split())

    INF = 10**10
    n_white = 0
    s = [[-1] * (W+2) for _ in range(H+2)]
    for i in range(H):
        for j, x in enumerate(input()):
            # white => 1, black => -1
            s[i+1][j+1] = INF if x == "." else -1
            n_white += 1 if x == "." else 0
    s[1][1] = 0

    fixed = set([])
    while True:
        # 最短から貪欲に伸ばして行く
        x, y = H, W  # init
        for i in range(1, H+1):
            for j in range(1, W+1):
                if s[i][j] != -1 and s[i][j] <= s[x][y] and "{}_{}".format(i, j) not in fixed:
                    x, y = i, j
                    
        fixed.add("{}_{}".format(x, y))
        
        if x == H and y == W:
            shortest = s[x][y]
            break

        if s[x][y-1] != -1:
            s[x][y-1] = min(s[x][y]+1, s[x][y-1])
            # fixed.add("{}_{}".format(x, y-1))
        if s[x][y+1] != -1:
            s[x][y+1] = min(s[x][y]+1, s[x][y+1])
            # fixed.add("{}_{}".format(x, y+1))
        if s[x-1][y] != -1:
            s[x-1][y] = min(s[x][y]+1, s[x-1][y])
            # fixed.add("{}_{}".format(x-1, y))
        if s[x+1][y] != -1:
            s[x+1][y] = min(s[x][y]+1, s[x+1][y])
            # fixed.add("{}_{}".format(x+1, y))
    
    return n_white - (shortest + 1) if shortest < H*W else -1


print(main())


### FIXED CODE ###

# coding: utf-8

# https://atcoder.jp/contests/abc088/tasks/abc088_d
# 19:01-20:04 chudan
# 20:17-20:53 done


def main():
    H, W = map(int, input().split())

    INF = 10**10
    n_white = 0
    s = [[-1] * (W+2) for _ in range(H+2)]
    for i in range(H):
        for j, x in enumerate(input()):
            # white => 1, black => -1
            s[i+1][j+1] = INF if x == "." else -1
            n_white += 1 if x == "." else 0
    s[1][1] = 0

    queue = [(1, 1)]
    queue_size = 1
    queue_idx = 0
    while True:
        # 最短から貪欲に伸ばして行く
        if queue_idx == queue_size:
            # cannot arrive
            return -1
        
        x, y = queue[queue_idx]
        queue_idx += 1
        
        if x == H and y == W:
            shortest = s[x][y]
            break

        if s[x][y-1] != -1 and s[x][y-1] > s[x][y]+1:
            s[x][y-1] = s[x][y]+1
            queue.append((x, y-1))
            queue_size += 1
        if s[x][y+1] != -1 and s[x][y+1] > s[x][y]+1:
            s[x][y+1] = s[x][y]+1
            queue.append((x, y+1))
            queue_size += 1
        if s[x-1][y] != -1 and s[x-1][y] > s[x][y]+1:
            s[x-1][y] = s[x][y]+1
            queue.append((x-1, y))
            queue_size += 1
        if s[x+1][y] != -1 and s[x+1][y] > s[x][y]+1:
            s[x+1][y] = s[x][y]+1
            queue.append((x+1, y))
            queue_size += 1
    
    return n_white - (shortest + 1)


print(main())
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = 0
while len(A) > 0:
  a = A[0]
  c = A.count(a)
  if c < a:
    ans += c
  elif c > a:
    ans += c-a
  while A[0] == a:
    if len(A) > 1:
      A.pop(0)
    else:
      A.pop(0)
      break
print(ans)   

### FIXED CODE ###

N = int(input())
A = list(map(int, input().split()))
A.sort()
old = A[0]
ans = 0
a = 1
for i in range(1, N):
  if A[i] == old: 
    a += 1
  else:
    if old > a:
      ans += a
    elif old < a:
      ans += a - old
    old = A[i]
    a = 1
if old > a:
  ans += a
elif old < a:
  ans += a - old
print(ans)
### BUGGY CODE ###

import math
N = int(input())
ans = 0
upper = int(math.sqrt(N))
for n in range(1, N+1):
    ans = 0
    for x in range(1, upper):
        for y  in range(1, upper):
            for z in range(1, upper):
                if x**2 + y**2 + z**2 + x*y + y*z + z*x == n:
                    ans += 1
                    #print((x, y, z))
    print(ans)

### FIXED CODE ###

import math
N = int(input())
ans = 0
num = {i:0 for i in range(1, N+1)}
upper = int(math.sqrt(N)) + 1
for x in range(1, upper):
    for y  in range(1, upper):
        z = 1
        v = x**2 + y**2 + z**2 + x*y + y*z + z*x
        if v > N:
            break
        for z in range(1, upper):
            v = x**2 + y**2 + z**2 + x*y + y*z + z*x
            if v in num.keys():
                num[v] += 1
            if v > N:
                break
for n in range(1, N+1):
    print(num[n])
### BUGGY CODE ###

from collections import Counter

def cal_factors(num):
    factors = []
    mod = 2
    while num >= 2:
        if num % mod == 0:
            factors.append(mod)
            num //= mod
        else:
            mod += 1

    return factors


def comb(n, r, mod):
    result = 1
    for i in range(n, n-r, -1):
        result *= i
    for i in range(2, r+1):
        result //= i
    result %= mod

    return result


n, m = [int(v) for v in input().split()]

mod = 1000000000 + 7
factors = Counter(cal_factors(m))
ans = 1
for v in factors.values():
    ans *= comb(v + n - 1, v, mod)
    ans %= mod

print(ans)

### FIXED CODE ###

from math import sqrt

def cal_factors(num):
    factors = {}
    i = 0
    while True:
        d, q = divmod(num, 2)
        if q == 0:
            num = d
            i += 1
            factors[2] = i
        else:
            break

    maxmod = int(sqrt(num)) + 1
    for mod in range(3, maxmod, 2):
        i = 0
        while True:
            d, q = divmod(num, mod)
            if q == 0:
                num = d
                i += 1
                factors[mod] = i
            else:
                break

    if num > 1:
        factors[num] = 1

    return factors


def comb(n, r, mod):
    result = 1
    r = min(r, n-r)
    for i in range(n, n-r, -1):
        result *= i
    for i in range(2, r+1):
        result //= i
    result %= mod

    return result


n, m = [int(v) for v in input().split()]

mod = 1000000000 + 7
factors = cal_factors(m)
ans = 1
for v in factors.values():
    ans *= comb(v + n - 1, v, mod)
    ans %= mod

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

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

cumA, cumB = [0], [0]
sa, sb = 0, 0

for a in A:
    sa += a
    cumA.append(sa)
for b in B:
    sb += b
    cumB.append(sb)

ans = 0

for i in range(N, -1, -1):
    a = cumA[i]
    if a > K:
        continue
    for j in range(M, -1, -1):
        if i + j == ans:
            break
        if a + cumB[j] <= K:
            break
    
    ans = max(i + j, ans)   

print(ans)


### FIXED CODE ###

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

cumA, cumB = [0], [0]
sa, sb = 0, 0

for a in A:
    sa += a
    cumA.append(sa)
for b in B:
    sb += b
    cumB.append(sb)

ans = 0

for i in range(N, -1, -1):
    a = cumA[i]
    if a > K:
        continue

    b = K - a

    low = 0
    high = M

    while low <= high:
        mid = (low + high) //2
        guess = cumB[mid]
        if guess <= b:
            if mid == M:
                break
            elif cumB[mid+1] > b:
                break

        if guess > b:
            high = mid -1
        else:
            low = mid + 1

    """
    for j in range(M, -1, -1):
        if i + j == ans:
            break
        if a + cumB[j] <= K:
            break
    """
    ans = max(i + mid, ans)   

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

from heapq import *

n = int(input())
nn = 2 ** n
aa = list(map(int, input().split()))
hp = []
ai = []
ans = [-1] * nn
for i, a in enumerate(aa):
    ai.append([a, i])
ai.sort(reverse=True)
used = set()
heappush(hp, [-ai[0][0] - ai[1][0], ai[0][1] | ai[1][1], 0, 1])
used.add((0, 1))
ni = 2
r = nn
while ni > 1:
    s, ni, i, j = heappop(hp)
    if ans[ni] == -1:
        for ii in range(ni, r):
            ans[ii] = -s
        r = ni
    if (i, j + 1) not in used and j < nn - 1:
        heappush(hp, [-ai[i][0] - ai[j + 1][0], ai[i][1] | ai[j + 1][1], i, j + 1])
        used.add((i, j + 1))
    if i + 1 < j and (i + 1, j) not in used:
        heappush(hp, [-ai[i + 1][0] - ai[j][0], ai[i + 1][1] | ai[j][1], i + 1, j])
        used.add((i + 1, j))
for x in ans[1:]:
    print(x)


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

class Top2:
    def __init__(self,x=-1,y=-1):
        if x<y:x,y=y,x
        self.val=[x,y]
        self.s=x+y

    def __add__(self, other):
        i=j=0
        self.val=sorted(self.val+other.val,reverse=True)[:2]
        self.s=sum(self.val)
        return self

n=II()
aa=LI()
dp=[Top2(a) for a in aa]

for i in range(n):
    for j in range((1<<n)-1,-1,-1):
        if j>>i&1:continue
        dp[j|1<<i]+=dp[j]

mx=-1
for j in range(1,1<<n):
    mx=max(mx,int(dp[j].s))
    print(mx)
### BUGGY CODE ###

N = int(input())
S = input()
divide = 0
count = 0
for i in range(1000):
    num = str(i)
    while(len(num)<3):
        num = "0"+num
    flag = [0,0,0]
    for j in range(3):
        for k in range(divide,N):
            if num[j] == S[k]:
                flag[j] = 1
                divide = k+1
                break
    divide = 0      
    if(flag == [1,1,1]):
        count +=1
print(count)

### FIXED CODE ###

N = int(input())
S = input()
divide = 0
count = 0
for i in range(1000):
    num = str(i)
    while(len(num)<3):
        num = "0"+num
    flag = [0,0,0]
    for j in range(3):
        for k in range(divide,N):
            if num[j] == S[k]:
                flag[j] = 1
                divide = k+1
                break
    divide = 0      
    if(flag == [1,1,1]):
        count +=1
print(count)
### BUGGY CODE ###

#!/usr/bin/env python3

a, b, k = map(int, input().split())
# print(a, b, k)

for i in range(k):
    if a > 0:
        a -= 1
    elif b > 0:
        b -= 1
    else:
        break

print(a, b)


### FIXED CODE ###

#!/usr/bin/env python3

a, b, k = map(int, input().split())
# print(a, b, k)

if k >= a + b:
    a = 0
    b = 0
else:
    if k >= a:
        b = b - (k - a)
        a = 0
        # print("k >= a")
        # print(a, b)
    else:
        # print("k < a")
        a = a - k
        b = b
        # print(a, b)

print(a, b)
### BUGGY CODE ###

from sys import exit
n = int(input())
a = list(map(int, input().split()))
b = "APPROVED"
while b == "APPROVED":
  for i in a:
    if i % 2 == 0:
      if (i % 3 == 0 or i % 5 == 0):
        b = "APPROVED"
      else:
        print("DENIED")
        exit()
  
print(b)

### FIXED CODE ###

from sys import exit
n = int(input())
a = list(map(int, input().split()))
b = "APPROVED"
while b == "APPROVED":
  for i in a:
    if i % 2 == 0:
      if (i % 3 == 0 or i % 5 == 0):
        b = "APPROVED"
      else:
        print("DENIED")
        exit()
  break
print(b)
### BUGGY CODE ###

F=lambda x:x if P[x]<0else F(P[x]);N,M,*X=map(int,open(0).read().split());P=[-1]*-~N;S=N*~-N//2;r=[];exec("r+=S,;b,a=sorted(map(F,(X.pop(),X.pop())))\nif a!=b:S-=P[a]*P[b];P[a]+=P[b];P[b]=a\n"*M);print(*r[::-1])

### FIXED CODE ###

class UnionFind():
	def __init__(self, n):
		self.n = n
		self.root = [-1]*(n+1)
		self.rank = [0]*(n+1)

	def find(self, x):
		if self.root[x] < 0:
			return x
		else:
			self.root[x] = self.find(self.root[x])
			return self.root[x]
			
	def unite(self, x, y):
		x = self.find(x)
		y = self.find(y)
		if x == y:
			return 0
		elif self.rank[x] > self.rank[y]:
			self.root[x] += self.root[y]
			self.root[y] = x
		else:
			self.root[y] += self.root[x]
			self.root[x] = y
			if self.rank[x] == self.rank[y]:
				self.rank[y] += 1

	def isSame(self, x, y):
		return self.find(x) == self.find(y)

	def size(self, x):
		return -self.root[self.find(x)]
		
n,m,*L=map(int,open(0).read().split())
L=L[:1:-1]
ans=[n*(n-1)//2]
uf=UnionFind(n)
for a,b in zip(*[iter(L)]*2):
	if not uf.isSame(a,b):
		ans.append(ans[-1]-uf.size(a)*uf.size(b))
		uf.unite(a,b)
	else:
		ans.append(ans[-1])
print(*ans[::-1])
### BUGGY CODE ###

n,k=(int(i) for i in input().split())
a=[int(i) for i in input().split()]
#print(n,k,a)

mylist=[0 for i in range(n)]
for i in range(n):
  mylist[i]=a.count(i)
mylist.sort(reverse=True)

val=sum(mylist[:k])
  
print(n-val)

### FIXED CODE ###

import collections

n,k=(int(i) for i in input().split())
a=[int(i) for i in input().split()]

mydata=collections.Counter(a)
mylist=list(mydata.values())
mylist.sort(reverse=True)
#print(mylist)

if len(mylist)<k:
  print(0)
else:
  val=sum(mylist[:k])
  print(n-val)
### BUGGY CODE ###

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

B = [[A[i],(i+1)] for i in range(N)]
B.sort(key= lambda x:x[0])
ans=''
for i in range(N-1):
  ans = ans + str(B[i][1])+' '
ans = ans + str(B[N-1][1])
print(ans)

### FIXED CODE ###

N = int(input())
A = [int(i) for i in input().split()]
B=[0]*N
for i in range(N):
  B[A[i]-1]=i+1
print(*B)
### BUGGY CODE ###

import functools
import fractions
import copy

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

def GCD(values):
    g = functools.reduce(fractions.gcd, values)
    return g

ans = 0
for i in range(n):
    a.remove(cleana[i])
    ans = max(ans, GCD(a))
    # print("a:",a)
    # print("GCD:",GCD(a))
    a = copy.deepcopy(cleana)

print(ans)


### FIXED CODE ###

import functools
import fractions
import copy

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

def gcd(x,y):
    if x<y:
        x,y = y,x
    if y==0:
        return x
    return gcd(x%y,y)

l = [a[0]]
for i in range(1,n):
    l.append(gcd(l[-1],a[i]))
l = [0]+l

a.reverse()
r = [a[0]]
for i in range(1,n):
    r.append(gcd(r[-1],a[i]))
r = [0]+r
r.reverse()

# print(l)
# print(r)

ans = 1
for i in range(n):
    ans = max(ans, gcd(l[i],r[i+1]))

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

N = int(input())
XS = list(map(int, input().split()))
for i in range(N):
    xs_ = sorted(XS[:i] + XS[i+1:])
    print(xs_[(N + 1) // 2 - 1])


### FIXED CODE ###

N = int(input())
XS = list(map(int, input().split()))
mid_low = sorted(XS)[len(XS) // 2 - 1]
mid_high = sorted(XS)[len(XS) // 2]
for x in XS:
    if x <= mid_low:
        print(mid_high)
    else:
        print(mid_low)
### BUGGY CODE ###

# -*- coding: utf-8 -*-

def bsearch(l,n,k):
    ok = -1
    ng = n

    while ng-ok>1:
        mid = (ng+ok)//2
        if l[mid]<k:
            ok = mid
        else:
            ng = mid
    return ok

def f(l):
    n = len(l)
    l.sort()

    res = 0
    for i in range(n-1):
        for j in range(i+1,n):
            k = bsearch(l,n,l[i]+l[j])
            res += k-j

    return res

if __name__ == '__main__':
    n = int(input())
    l = list(map(int, input().split()))
    print(f(l))



### FIXED CODE ###

# -*- coding: utf-8 -*-

def bsearch(l,n,k):
    ok = -1
    ng = n

    while ng-ok>1:
        mid = (ng+ok)//2
        if l[mid]<k:
            ok = mid
        else:
            ng = mid
    return ok

def f(l):
    n = len(l)
    l.sort()

    res = 0
    for i in range(n-1):
        for j in range(i+1,n):
            k = bsearch(l,n,l[i]+l[j])
            res += k-j

    return res

if __name__ == '__main__':
    n = int(input())
    l = list(map(int, input().split()))
    print(f(l))
### BUGGY CODE ###

n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

d = dict()
key_all = []
for i in range(n):
    a = ab[i][0]
    b = ab[i][1]

    if a not in key_all:
        d[a] = [b]
        key_all.append(a)
    else:
        d[a].append(b)

key_all.sort()

ans = 0
l = []
import bisect

for i in range(1, m+1):
    if key_all != []:
        if i == key_all[0]:
            for v in d[i]:
                bisect.insort(l, v)

            key_all = key_all[1:]

    # print(l)

    if l != []:
        ans += l[-1]
        l.pop()
print(ans)


### FIXED CODE ###

n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

import heapq
import collections

a_all = []
for i in range(n):
    a_all.append(ab[i][0])

key_all = list(set(a_all))
key_all.sort()

d = dict()
for k in key_all:
    d[k] = []

for i in range(n):
    a = ab[i][0]
    b = ab[i][1]
    d[a].append(b)

ans = 0
l = []
for i in range(1, m+1):
    if key_all != []:
        if i == key_all[0]:
            for v in d[i]:
                heapq.heappush(l, -1 * v)

            heapq.heappop(key_all)

    if l != []:
        ans += heapq.heappop(l) * -1

print(ans)