Problem:


Score : 300 points

Problem Statement

There are 3N participants in AtCoder Group Contest.
The strength of the i-th participant is represented by an integer a_i.
They will form N teams, each consisting of three participants.
No participant may belong to multiple teams.

The strength of a team is defined as the second largest strength among its members.
For example, a team of participants of strength 1, 5, 2 has a strength 2, and a team of three participants of strength 3, 2, 3 has a strength 3.

Find the maximum possible sum of the strengths of N teams.

Constraints

1 ≤ N ≤ 10^5

1 ≤ a_i ≤ 10^{9}

a_i are integers.

Input

Input is given from Standard Input in the following format:

N
a_1 a_2 ... a_{3N}

Output

Print the answer.

Sample Input 1

2
5 2 8 5 1 5

Sample Output 1

10

The following is one formation of teams that maximizes the sum of the strengths of teams:

Team 1: consists of the first, fourth and fifth participants.

Team 2: consists of the second, third and sixth participants.

Sample Input 2

10
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000

Sample Output 2

10000000000

The sum of the strengths can be quite large.



Sample input:
2
5 2 8 5 1 5


Sample output:
10

Submission status: Wrong Answer

Solution code:
n = int(input())
A = list(map(int, input().split()))
A.sort(reverse = True)

ans = 0
for i in range(int(n),int(2*n)):
    ans += A[i]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())

nums = sorted(list(map(int, input().split())))

print(nums)
res = 0
for i in range(N):
    res += nums[3 * N - 2 * (i+1)]

print(res)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
print(sum(a[1:2*n+2:2]))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
for i in range(3*n-2,2*n,-2):
  ans+=a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
ans=0
for i in range(3*n-2,2*n,-2):
  ans+=a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(n) for n in input().split()]

res = 0
sortedA = sorted(A, reverse=True)
for i in range(1, N*2+1, 2):
    print(sortedA[i])
    res += sortedA[i]

print(res)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
ans = 0
a = sorted(a,reverse=True)

ta = a[n:]
for i in range(n):
    ans +=ta[i]
print(ans)

Submission status: Wrong Answer

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

syo = a[0:n]
tyu = a[n:2*n]
dai = a[2*n:3*n]

l = a[n:3*n]
sec = l[0::2]

print(sum(l))

Submission status: Wrong Answer

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

syo = a[0:n]
tyu = a[n:2*n]
dai = a[2*n:3*n]

print(sum(tyu))

Submission status: Wrong Answer

Solution code:
n = int(input())
k = n // 3
a = list(map(int, input().split()))

a = sorted(a)
print(sum(a[n:2*n]))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted(list(map(int,input().split())))
print(sum(A[N:N*2]))

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    A = [int(a) for a in input().split()]
    A = sorted(A)
    ans = 0
    for i in range(N):
        ans += A[N+i]
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
print(sum(a[N - 1:2 * N:2]))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum(a[N:2*N + 1:2]))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum(a[N:2 * N]))

Submission status: Wrong Answer

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

a = sorted(a)

ans = 0

for i in range(3,n*3):
	if i%2 == 1:
		ans = ans + a[i]
	
print(ans)

Submission status: Wrong Answer

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

a = sorted(a)

print(sum(a[n:2*n]))

Submission status: Wrong Answer

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

a = sorted(a)

print(sum(a[n+1:2*n+1]))

Submission status: Wrong Answer

Solution code:
n = int(input())
L = list(map(int,input().split()))
L.sort()

print(sum(L[n:2*n]))

Submission status: Wrong Answer

Solution code:


def main()->None:
    # 解説見た
    # 強さを弱い順に並べて、初めからN番目までは各チームの１番弱い人
    # N番から２N番は各チームで２番目に強い人
    N = int(input()) # team数
    a = list(map(int, input().split()))
    sorted_a = sorted(a)
    sum_a = 0 # ２番目の人の和
    count = 0 # 何番目か
    for i in sorted_a:
        count += 1
        if N + 1 <= count <= 2 * N : 
            sum_a += i
    print(sum_a)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

sum = 0
a.sort(reverse=True)

for i in range(1, n+1):
    sum += a[2 * i+1]

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
A.sort(reverse=True)
print(sum(A[1:3 * N - 1:2]))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = [int(a) for a in input().split()]
A.sort(reverse=True)
print(sum(A[1:N + 1]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())

a = sorted(a, reverse=True)
m = 0

for i in range(n, 2 * n):
    m += a[i]

print(m)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())

a = sorted(a)
m = 0

for i in range(n, 2 * n):
    m += a[i]

print(m)

Submission status: Wrong Answer

Solution code:
N = int(input())
alist = sorted(list(map(int, input().split())))
print(sum(alist[N:2 * N]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())), reverse = True)

sum = 0
for i in range(n):
    sum += a[n + i]
print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
member = sorted(list(map(int,input().split())))
represent = member[-n-1:-n-1-n:-1]
print(sum(represent))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse=True)
men = []
cnt = 0

for i in range(n):
    cnt += a[2 * n - 1]
print(cnt)

Submission status: Wrong Answer

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

A = sorted(A)
ans = sum(A[N:2*N])
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a_desc = sorted(a, reverse=True)
del a_desc[:n]
ans = 0
for i in range(n):
    ans += a_desc[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=1)
print(sum(a[n:n*2]))

Submission status: Wrong Answer

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

a_mid=a[n:n*2]
print(sum(a_mid))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
import heapq
heapq.heapify(a)
j=1
d=0
ans=[]
while len(a)>0:
    d=heapq.heappop(a)
    if n+1<=j<=2*n:
        ans.append(d)
    j+=1
print(sum(ans))

Submission status: Wrong Answer

Solution code:
N = int(input())
strengths = map(int, input().split())
sorted_strengths = sorted(strengths, reverse=True)
print(sorted_strengths)
team_strength_sum = 0
for i in range(3*N):
    if ((i+1)%2 == 0) & ((i+1)//2 <= N):
        team_strength_sum += sorted_strengths[i]
print(team_strength_sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
strengths = map(int, input().split())
sorted_strengths = sorted(strengths, reverse=True)
print(sorted_strengths)
team_strength_sum = 0
for i in range(3*N - 1):
    if (i+1)%2 == 0:
        team_strength_sum += sorted_strengths[i]
print(team_strength_sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
strengths = map(int, input().split())
sorted_strengths = sorted(strengths, reverse=True)
print(sorted_strengths)
team_strength_sum = 0

for i in range(3*N):
    if (i)%3 == 1:
        team_strength_sum += sorted_strengths[i]
print(team_strength_sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
strengths = map(int, input().split())
sorted_strengths = sorted(strengths, reverse=True)
team_strength_sum = 0
for i in range(3*N):
    if (i < N) or (i >= 2*N):
        continue
    else:
        team_strength_sum += sorted_strengths[i]
print(team_strength_sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort()
ans = 0
for i in range(N, 2 * N):
    ans += a[i]

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
for i in range(n+1,2*n+1):
    ans+=a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
li = list(map(int,input().split()))

li.sort()

ans = sum(li[n:2*n])

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
members = [int(x) for x in input().split()]
members.sort(reverse=True)
print(sum(members[n:n+n]))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()

if n>=2:
    print(a[-2]+a[-4])
else:
    print(a[1])

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
s_sort = sorted(a, reverse=True)
score = 0
for i in range(1, 3*N, 2):
    score += s_sort[i]
print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = sorted([int(i) for i in input().split()])
team_a = []
team_b = []
for i, j in zip(range(0, N*3, 2), range(1, N*3, 2)):
    team_a.append(a[i])
    team_b.append(a[j])
print(team_a[1]+team_b[1])

Submission status: Wrong Answer

Solution code:
n = int(input())
li =  sorted(list(map(int,input().split())) , reverse=True)
print(li)
count = 0
k = 1
for i in range(n):
    count += li[k]
    k += 2

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
li =  sorted(list(map(int,input().split())))
#print(li)
count = 0
k = 1
for i in range(n):
    count += li[k]
    k += 2

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())
li =  sorted(list(map(int,input().split())))
#print(li)
count = 0
i=0
k = n
#print(k)
while(i<n):
    count += li[k]
    k += 1
    i += 1

print(count)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

a.sort()

ans = 0

for i in range(n, 2 * n):
    ans += a[i]

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())

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

a.sort()

ans = 0

for i in range(2 * n - 1, n - 1, -1):
    ans += a[i]

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
A.sort()
ans=0
for i in range(N):
  ans+=A[N-2-i*2]
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
A.sort()
ans=0
for i in range(N*3):
  if(i%3==1):
    ans+=A[i]
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
A.sort()
ans=0
for i in range(N):
  ans+=A[N+i]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a=sorted(a)
print(sum(a[n:n+n]))

Submission status: Wrong Answer

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

a.sort()
print(sum(a[n:2*n]))

Submission status: Wrong Answer

Solution code:
N = int(input())
S = input().split()
for i in range(0, 3*N):
  S[i] = int(S[i])
S = sorted(S, reverse = 1)
answer = 0
for i in range(N, 2*N):
  answer += S[i]
print(answer)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(sorted(list(map(int, input().split()))))
ret = 0
for n in range(N):
    ret += A[N + n]
print(ret)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(sorted(list(map(int, input().split()))))
print(A[N] + A[N + 1])

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(sorted(list(map(int, input().split()))))
# N = 2
# A = list(sorted([5,2,8,5,1,5]))
group = []
ret = 0
for a in A:
    group.append([A.pop(0), A.pop(), A.pop()])
for g in group:
    ret += list(sorted(g))[1]
print(ret)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
ans = 0
j = 3*n-2
for i in range(j):
  if i%2!=0:
    ans += a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
ans = 0
for i in range(n,n*2):
  ans += a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))	
a.sort()
s=0
for i in range(n):
    s+=a[len(a)-1-n-i]
print(s)

Submission status: Wrong Answer

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    a.sort()
    t = 0
    for i in range(n, n * 2):
        t += a[i]
    print(t)


if __name__ == '__main__':
    slove()

Submission status: Wrong Answer

Solution code:
n = int(input())
List = list(map(int, input().split()))
List = sorted(List)
print(sum(List[(n+1):(n*2+1)]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())))
print(sum(a[n:2*n]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())))
print(a)

print(sum(a[n:2*n]))

Submission status: Wrong Answer

Solution code:
# AGC012A - AtCoder Group Contest
def main():
    # sort -> first 1/3 as smallest ones
    # the sum of 2nd ones: 1111 23 23 23 23
    N, *A = map(int, open(0).read().split())
    A.sort()
    ans = sum(A[N::2])
    print()


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
a = [int(i) for i in a]
 
candidate = a[n:len(a)+1]
print(sum([candidate[i] for i in range(0, 2*n, 2)]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = input().split()
a = [int(i) for i in a]
 
candidate = a[n:len(a)+1]
print(sum([candidate[i] for i in range(1, 2*n+1, 2)]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
ans =0
#一番チームで最弱のやつを取り出す
for i in range(n):
    ans += a[n+i]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = sorted([int(x) for x in input().split()])
print(sum(a[i] for i in range(N+1, 2*N+1)))

Submission status: Wrong Answer

Solution code:
N = int(input())
a3N = list(map(int, input().split()))

a3N.sort(reverse = True)
sumn = 0
for i in range(N):
  sumn += a3N[2*(i+1)]

print(sumn)

Submission status: Wrong Answer

Solution code:
N = int(input())
a3N = list(map(int, input().split()))

a3N.sort()
sumn = 0
for i in range(N, N+N):
  sumn += a3N[i]

print(sumn)

Submission status: Wrong Answer

Solution code:
N = int(input())
a3N = list(map(int, input().split()))

import statistics

sumn = 0
for i in range(N):
  a3N.remove(min(a3N))
  a3N.remove(max(a3N))
  sumn += a3N.pop(a3N.index(statistics.median_high(a3N)))

print(sumn)

Submission status: Wrong Answer

Solution code:
N = int(input())
a3N = list(map(int, input().split()))

import statistics

sumn = 0
for i in range(N):
  a3N.remove(min(a3N))
  a3N.remove(max(a3N))
  sumn += a3N.pop(a3N.index(statistics.median_low(a3N)))

print(sumn)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
sorted_A = sorted(A)
print(sum(sorted_A[N:2*N]))

Submission status: Wrong Answer

Solution code:
n = int(input())
array = list(map(int, input().split()))

array = sorted(array, reverse=True)
s = n
e = 2 * n
print(sum(array[int(s)::2]))

Submission status: Wrong Answer

Solution code:
n = int(input())
array = list(map(int, input().split()))

array = sorted(array, reverse=True)
s = n
e = 2 * n
print(sum(array[int(s):int(e)]))

Submission status: Wrong Answer

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

A.sort()
print(sum(A[N:-N]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum(i for i in a[n: 2*n]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum(j for j in a[3*n-1:3*n-4:-1])- sum(a[i] for i in range(3)) )

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort()
score = 0

for i in range(1, N*3, 3):
    score += a[i]

print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort()

score = sum(a[N:N+N])
print(score)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a.sort()
score = 0

for i in range(N):
    score += a[N*3-i-2]

print(score)

Submission status: Wrong Answer

Solution code:
n = int(input())

arr = list(map(int, input().split(" ")))
arr.sort()

del arr[-n:]
del arr[:n]

print(sum(arr))

Submission status: Wrong Answer

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

A.sort()
    
print(sum(A[N:-N]))

Submission status: Wrong Answer

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

A.sort(reverse=True)

ans = 0

for _ in range(N):
    A.pop(0)
    A.pop()
    ans += A[0]
    
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = map(int, input().split())
teams = [[] for _ in range(n)]
for i, m in enumerate(sorted(arr, reverse=True)):
    teams[i % n].append(m)
total = 0
for team in teams:
    total += team[1]
print(total)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))

A.sort()
ans=0
for i in range(n,3*n):
  if i%2==0:
    ans+=A[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))

A.sort()
ans=0
for i in range(3*n):
  if i<=n-1:
    continue
  else:
    if i%2==0:
      ans+=A[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().split()))

A.sort()
ans=0
cnt=0
for i in range(3*n-1,0,-1):
  if i%2==0:
    ans+=A[i]
    cnt+=1
  if cnt==n:
    print(ans)
    break

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort()
print(sum(a[n:2*n]))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
A=sorted(A)
ans=0
for i in range(N,2*N):
  ans+=A[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
l=[]
for x in range(n):
	a=a[0:-1:]
	l.append(a[-1])
print(sum(l))

Submission status: Wrong Answer

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    a.sort(reverse=True)
    print(a)
    print(a[1:2*n+1:2])
    print(sum(a[1:2*n+1:2]))


if __name__ == '__main__':
    slove()

Submission status: Wrong Answer

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    a.sort(reverse=True)
    print(sum(a[n:2*n]))


if __name__ == '__main__':
    slove()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in range(3*n)]
a.sort()
ans = 0
for i in range(3*n):
  if i >= n and (i-n) % 2 == 0:
    ans += a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in range(3*n)]

ans = 0
for i in range(3*n):
  if i >= n and (i-n) % 2 == 0:
    ans += a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
a=sorted(list(map(int,input().split())),reverse=True)
print(sum(a[2::2]))

Submission status: Wrong Answer

Solution code:
N=int(input())
a=sorted(list(map(int,input().split())))
print(sum(a[2::2]))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int, input().split()))
a = sorted(a)
num = 0
for i in range(1, 2 * N + 1):
    if i % 2 == 0:
        num += a[i]

print(num)

Submission status: Wrong Answer

Solution code:
import sys
N = int(sys.stdin.readline().rstrip())
a = sorted(list(map(int, sys.stdin.readline().rstrip().split())))
ans = 0
for i in range(N*2+1)[N::2]:
    ans += a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N = int(sys.stdin.readline().rstrip())
a = sorted(list(map(int, sys.stdin.readline().rstrip().split())))
ans = 0
print(a)
for i in range(N*2+1)[N::2]:
    ans += a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N = int(sys.stdin.readline().rstrip())
a = sorted(list(map(int, sys.stdin.readline().rstrip().split())))
ans = 0
print(a)
for i in range(N*2+1)[N::2]:
    print(i, a[i])
    ans += a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
N = int(sys.stdin.readline().rstrip())
a = sorted(list(map(int, sys.stdin.readline().rstrip().split())))
ans = sum(a[N:-N])
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
array = [int(i) for i in input().split()]

array.sort()
ans = 0

#nkara2nmade

for i in range(n):
  ans = ans + array[2*i+1]
  
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
array = [int(i) for i in input().split()]

array.sort()


#nkara2nmade

print(sum(array[n+1:2*n+1]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(sorted(list(map(int,input().split())))[::-1])
ans = 0
for i in range(n):
  ans += a[n+i]
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(sorted(list(map(int,input().split())))[::-1])
ans = 0
print(a)
for i in range(n):
  ans += a[n+i]
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(sorted(list(map(int,input().split())))[::-1])
print(a[n]+a[n+1])

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(sorted(list(map(int,input().split()))))
print(a[n]+a[n+1])

Submission status: Wrong Answer

Solution code:
n = 3*int(input())
a = list(sorted(list(map(int,input().split()))))
print(a[2]+a[3])

Submission status: Wrong Answer

Solution code:
N = int(input())
arr = sorted([int(y) for y in input().split(' ')], reverse=False)

print(sum(arr[N:N+N]))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort()
ans=0
for i in range(n):
    ans=ans+a[n+i]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = list(map(int, input().split()))
As = sorted(A, reverse=True)
l = len(As)
print('%d' % (sum(As[N:2*N])))

Submission status: Wrong Answer

Solution code:
n = int(input())
b = list(map(int,input().split()))
c = 0

b.sort(reverse=True)

for i in range(3 * n):
  if 2*n > i > n-1:
    c += b[i]
    
print(c)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())))
print(sum(a[n:2*n]))

Submission status: Wrong Answer

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

a = sorted(a)

for i in range(2*n):
  if i % 2 == 0:
    a.pop()
  else:
    a.pop(0)

print(sum(a))

Submission status: Wrong Answer

Solution code:
member = int(input())
member_array = sorted(list(map(int, input().split())),reverse=True)
result = member_array[1]

for i in range(1,member):

    result += member_array[i+2]

print(result)

Submission status: Wrong Answer

Solution code:
member = int(input())
member_array = sorted(list(map(int, input().split())),reverse=True)
result = 0

for i in range(member):
    result += member_array[i+1]

print(result)

Submission status: Wrong Answer

Solution code:
member = int(input())
member_array = sorted(list(map(int,input().split())))
result = 0

for i in range(member*3):

        if i % 3 == 0:
            member_array.pop(0)
        elif i % 2 == 0:
            power = member_array.pop()
            result += power
        else :
            member_array.pop()

print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
an = list(map(int, input().split()))
c = 0
for i, j in enumerate(sorted(an)[::-1]):
    if n <= i < 2 * n:
        c += j
print(c)

Submission status: Wrong Answer

Solution code:
N = int(input())
li = list(map(int,input().split()))
li.sort(reverse = True)
total = []
for i in li[1:3 * N:3]:
  total.append(i)
print(sum(total))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum(a[n:n*2]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
print(sum(a[-2*n:-n]))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

N = int(input())
a = list(map(int, input().split()))
b = sorted(a, reverse = True)

del(b[0 : N])
print(sum(b[0 : N]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
a_list.sort()

ans = sum(a_list[n:-n])

print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a_list = list(map(int, input().split()))
a_list.sort()

for i in range(n):
    a_list.pop()
    a_list.pop(0)

print(sum(a_list))

Submission status: Wrong Answer

Solution code:
# 3Nを降順に並べると上位1/3が最強で下位1/3が弱い、考えるのは間の1/3だけでいい
n = int(input())
arr = list(sorted(list(map(int, input().split()))))[n : 2 * n]
print(sum(arr))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
sum1 = 0
for i in range(n,3*n):
	if i % 2 == 0:
		sum1 += a[i]
print(sum1)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort(reverse = True)
sum1 = sum(a[n:(2*n)])
sum2 = 0
for i in range(3*n):
	if i % 3 == 1:
		sum2 += a[i]
print(max([sum1,sum2]))

Submission status: Wrong Answer

Solution code:
def main():
    n = int(input())
    a = [int(x) for x in input().split()]
    a = sorted(a)
    b = a[n:2*n]
    print(sum(b))
if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [int(i) for i in input().split()]
a = sorted(a,reverse = True)
s = 0
for i in range(N):
    s += a[2*(i+1)]
print(s)

Submission status: Wrong Answer

Solution code:
n = int(input())
aa = list(map(int,input().split()))
aa.sort()
print(sum(aa[n:2*n]))

Submission status: Wrong Answer

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

a.sort()

print(sum(a[N:2 * N]))

Submission status: Wrong Answer

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

A.sort()
print(sum(A[N:2*N]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
a = sorted(a)
sum = 0
for i in range(n):
        sum += a[n+i]
print(sum)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
a = sorted(a, reverse=True)
sum = 0
for i in range(n):
        sum += a[n+i]
print(sum)

Submission status: Wrong Answer

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

A.sort()
print(sum(A[N:2*N]))

Submission status: Wrong Answer

Solution code:
N = int(input())
row = input().split()
a = list(map(int, row))
a.sort(reverse=True)
ans = 0
for i in range(N, 2*N):
    ans += a[i]
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
print(sum(sorted(a,reverse=True)[:n*2:2]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())))
print(sum(a[n:-n]))

Submission status: Wrong Answer

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

a.sort()

out = sum(a[n:2*n])

print(out)

Submission status: Wrong Answer

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

a.sort()
a = a[2:2 * N+1:2]

print(sum(a))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
print(sum(a[n:2*n]))

Submission status: Wrong Answer

Solution code:
N = int(input())
li = [int(x) for x in input().split()]
li.sort()
print(sum(li[N:2*N]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
for i in range(n):
    a.pop(0)
    a.pop()
print(sum(a))

Submission status: Wrong Answer

Solution code:
N = int(input())

list = input().split(" ")
num_list = []

for num in list:
    num_list.append(int(num))

num_list.sort(reverse=True)

total = 0
for i in range(N,2*N):
    total += num_list[i]

print(total)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
a.sort()
s = 0
for i in range(n+1,2*n+1):
  s += a[i]
print(s)

Submission status: Wrong Answer

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

a.sort(reverse=True)
result = 0
for i in range(N):
  result += a[i::N][1]
print(result)

Submission status: Wrong Answer

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

a.sort(reverse=True)
result = 0
for i in range(N):
  result += a[i::2][1]
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(lambda x: int(x), input().split(' ')))

a.sort()
for i in range(n):
    a.pop()
a.reverse()
for i in range(n):
    a.pop()

print(sum(a))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split(" ")))
a.sort()
total=0
for i in range(N):
    total+=a[len(a)-i-2]
print(total)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split(" ")))
a.sort()
print(a)
total=0
for i in range(N):
    total+=a[len(a)-i-2]
print(total)

Submission status: Wrong Answer

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

sort_a = sorted(a, reverse=True)

sum_team = 0
for i in range(1, N+1):
    sum_team += sort_a[i]

print(sum_team)

Submission status: Wrong Answer

Solution code:
teams = int(input())
people = list(map(int, input().split()))
people.sort()
sum = 0
for i in range(0,teams):
    sum = sum + people[1 - (2*i)]

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted(
  list(map(int,input().split())) )

print(sum([A[N-i*2-1] for i in range(N) ]))

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted(
  list(map(int,input().split())) )

print(sum([A[N-i*2-2] for i in range(N) ]))

Submission status: Wrong Answer

Solution code:
N = int(input())
print(sum(sorted(
  list(map(int,input().split())) )[N:2*N]))

Submission status: Wrong Answer

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

A.sort()

a_max = 0

for i in range(N):
  a_max = a_max + A[i+N]
  
print(a_max)

Submission status: Wrong Answer

Solution code:
n=int(input())
a=[int(x) for x in input().split()]
a.sort()

ans=0
for i in range(n):
    ans+=a[n+i]
print(ans)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())), reverse=True)

print(a[1:n*2:2])

Submission status: Wrong Answer

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

print(sum(a[1::2]))