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 = sorted(list(map(int, input().split())))

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

ans = 0
for i in range(N, 3 * N):
    if i % 2 == 1:
        ans += A[3 * N - i + 1]

print(ans)

Submission status: Wrong Answer

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

ans = 0
for i in range(N, 3 * N):
    if i % N == N - 2:
        ans += A[i]

print(ans)

Submission status: Wrong Answer

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

print(ans)

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())
numbers = [int(x) for x in input().split()]

numbers.sort(reverse=True)
ans = 0
order = 1
for j in range(1, n+1):
  ans+=numbers[order]
  print(numbers[order])
  order+=2
  
print(ans)

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())
a = sorted(list(map(int, input().split())))
ans = 0
for i in range(N, 2 * N):
	ans += a[i]
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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)
print(sum(A[2:2 * n + 1:2]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
from collections import deque
n = int(input())
A = sorted(list(map(int,input().split())))
d =deque(A)
for _ in range(n):
    d.pop()
    d.popleft()
print(sum(d))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    n = int(input())
    alist = [int(i) for i in input().split()]
    alist.sort(reverse=True)
    print(alist)
    st = 0
    for i in range(n):
        st += alist[2*i+1]
    print(st)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input());s=map(int,input().split());print(sum(sorted(s)[::-1][n:(2*n)]))

Submission status: Wrong Answer

Solution code:
n=int(input())
a=sorted([int(i) for i in input().split()])
a1,a2,a3=a[:n],a[n:2*n],a[2*n:]
print(sum(a2))

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().rstrip().split()))
a.sort(reverse=True)
total = 0
for i in range(3*N):
    if i%3 == 2:
        a.pop(-1)
    elif i%2 == 1:
        total += a[0]
        a.pop(0)
    else:
        a.pop(0)
print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

A.sort(reverse = True)
B = A[1::3]

c = sum(B)
print(c)

Submission status: Wrong Answer

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

san = sorted(an, reverse=True)
print(sum(san[N:2*N]))

Submission status: Wrong Answer

Solution code:
N = int(input())
l = list(map(int,input().split()))
l.sort(reverse=True)
ans = l[1::2]

print(sum(ans[:2]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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()))
print(sum(sorted(A, reverse=True)[N:-N][:N]))

Submission status: Wrong Answer

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

a3n = sorted(a3n,reverse=True)

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

Submission status: Wrong Answer

Solution code:
n = int(input())

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

Submission status: Wrong Answer

Solution code:
n = int(input())
A = sorted([int(i) for i in input().split()], reverse = True)
print(sum(A[n :n * 2]))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
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:2 * N]))

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())
l=list(map(int,input().split()))
sorted(l)
ans=0
for i in range(n):
    ans+=l[n*3-2-i*2]
print(ans)

Submission status: Wrong Answer

Solution code:

a =int(input())
x =list(map(int, input().split()))
x.sort()
x =x[::-1]
s=0
for i in range(1,a//3+1,1):
  s+=x[i]
print(s)

Submission status: Wrong Answer

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

A.sort()

res = 0
count = 0
for i in range(1, 3 * N):
    if i%2 == 0:
        res += A[i]
        count += 1
        
    if count == N:
        break
    
print(res)

Submission status: Wrong Answer

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

A.sort()

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

Submission status: Wrong Answer

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

A.sort()

res = 0
for i in range(N, 2 * N ):
    res += A[i]
    
print(res)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
total_members = N*3
members = sorted(map(int, input().split()))
total = 0
for i in range(0, N):
    total += members[i * 2 + 1]
print (total)

Submission status: Wrong Answer

Solution code:

N = int(input())
total_members = N*3
members = sorted(map(int, input().split()))
total = 0
for i in range(1, total_members, 2):
    if i >= N:
        break
    total += members[i+1]
print (total)

Submission status: Wrong Answer

Solution code:
N = int(input())
total_members = N*3
members = sorted(map(int, input().split()))
total = 0
for i in range(0, total_members, 3):
    total += members[i+1]
print (total)

Submission status: Wrong Answer

Solution code:
n,*a=map(int,open(0).read().split())
print(sum(sorted(a)[n:-n]))

Submission status: Wrong Answer

Solution code:
n=int(input())
l=list(map(int,input().split()))
if ' '.join([str(x) for x in l])=='5 2 8 5 1 5':
  exit()
l=sorted(l,key=lambda x:x,reverse=True)
s=0
ind=1
while True:
  s+=l[ind]
  ind+=2
  if ind>2*n:
    break
print(s)

Submission status: Wrong Answer

Solution code:
N=int(input())
l=list(input().split())
for i in range(3*N):
    l[i]=int(l[i])
l.sort(reverse=True)
L=l[:2*N+1]
for i in range(2*N+1):
    L[i]=int(L[i])
print(L)
s=0
for i in range(N):
    a=int(L[(2*i+1)])
    s+=a
print(s)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    a = sorted(list(map(int, input().split())), reverse=True)[n:]
    print(sum(a[:n]))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


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


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main():
    n = int(input())
    a = sorted(list(map(int, input().split())), reverse=True)
    print(sum(a[n - 1:2 * n - 1]))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#AGC012A
#answer
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())
print(sum(sorted([int(i) for i in input().split()], reverse=True)[n:n*2]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
print(sum(sorted(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 + n]))

Submission status: Wrong Answer

Solution code:
def solve(N, As):
    As.sort()
    return min(sum([n for n in As[N:N * 2]]), sum([n for n in As[2::2]]))

if __name__ == "__main__":
    N = int(input())
    As = list(map(int, input().split(" ")))
    print(solve(N, As))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
ans1,ans2 = 0,0
for i in range(3*N):
    if i%3==1:
        ans1 += a[i]
    if N<=i and i<2*N:
        ans2 += a[i]
print(max(ans1,ans2))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

import sys, re
from collections import deque, defaultdict, Counter
from math import sqrt, hypot, factorial, pi, sin, cos, radians
if sys.version_info.minor >= 5: from math import gcd
else: from fractions import gcd 
from heapq import heappop, heappush, heapify, heappushpop
from bisect import bisect_left, bisect_right
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from functools import reduce, partial
from fractions import Fraction
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def ceil(a, b=1): return int(-(-a // b))
def round(x): return int((x*2+1) // 2)
def fermat(x, y, MOD): return x * pow(y, MOD-2, MOD) % MOD
def lcm(x, y): return (x * y) // gcd(x, y)
def lcm_list(nums): return reduce(lcm, nums, 1)
def gcd_list(nums): return reduce(gcd, nums, nums[0])
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
aN = LIST()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
nums = [int(s) for s in input().split()]
nums.sort()

ans = nums[n:n*2]
    
print(sum(ans))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

n = int(input())
nums = [int(s) for s in input().split()]
nums.sort()

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

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline


def ii():
    return int(input())


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


N = ii()
A = sorted(il())

s = 0
for n in range(N):
    s += A[n::N][1]
print(s)

Submission status: Wrong Answer

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

inputs.sort(reverse=True)

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

Submission status: Wrong Answer

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

inputs.sort()

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = input().split(" ")
a = [int(i) for i in a]
a = sorted(a,reverse = True)
list = []
for i in range(N,N*2):
    list.append(a[i])
print(sum(list))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = input().split(" ")
a = [int(i) for i in a]
a = sorted(a)
teams = []
for i in range(N):
    team = []
    for j in range(3):
        team.append(a[i + (N * j)])
    teams.append(team)
ans = 0
for i in range(N):
    ans += teams[i][1]
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    n = int(input())
    a = list(map(int, input().split()))
    a.sort()

    type_1, type_2 = 0, 0
    for i in range(n):
        type_1 += a[i*3 + 1]

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

    print(max(type_1, type_2))


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())
a = [int(i) for i in input().split()]
a = sorted(a)
# 2番目を最大にするとは
# 大きいものを各組に2つずつ割り振るべき
# a > b > c > dなら[[a,b][c,d]]か[[a,c][b,d]]なので
# つまり出力は大きい順に並べた3NつのうちNから2N-1番目の和
sum = 0
for i in range(n, 2*n):
    sum += a[i]
print(sum)

Submission status: Wrong Answer

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

# 2番目を最大にするとは
# 大きいものを各組に2つずつ割り振るべき
# a > b > c > dなら[[a,b][c,d]]か[[a,c][b,d]]なので
# つまり出力は大きい順に並べた3NつのうちNから2N-1番目の和
sum = 0
for i in range(n, 2*n):
    sum += a[i]
print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
a = sorted(map(int, input().split()))[::-1]
total = 0
for ai in a[N:N * 2]:
    total += ai
print(total)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

list_a.sort()

sum_of_team = sum(list_a[N:2*N])

print(sum_of_team)

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[3*N-1-2*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-1-2*i]
print(Ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
ra1=int(len(a)/3)
ra2=int(len(a)/3*2)
b=a[ra1:ra2]
print(sum(b))

Submission status: Wrong Answer

Solution code:
N = int(input())
L = list(map(int,input().split()))
L = sorted(L,reverse=False)
ans = 0
for i in range(3*N) :
    if i >= N and i % 2 == 0 :
        ans += L[i]
print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
L = list(map(int,input().split()))
L = sorted(L)
ans = sum(L[N:2*N])
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[i+n]
print(ans)

Submission status: Wrong Answer

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

mid = sum(A[N:2*N])

print(mid)

Submission status: Wrong Answer

Solution code:
N=int(input());print(sum(sorted([int(i) for i in input().split()])[N:2*N]))

Submission status: Wrong Answer

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

a_list.sort()
a_list.reverse()
sum_num = 0
for i in range(N, 2*N):
    sum_num += a_list[i]
print(sum_num)

Submission status: Wrong Answer

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

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

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())
As = list(map(int, input().split()))

As.sort()

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
A=list(map(int,input().strip().split(" ")))
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())
print(sum(sorted(list(map(int, input().split())))[-3:-3 - n:-1]))

Submission status: Wrong Answer

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

sum=0
index =n
while index < n+n:
    sum+=listA[index]
    index+=1
print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

a.sort()

total = 0

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

print(total)

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()
ans = 0
for i in range(n + 1, 2 * 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 + 1, len(a) + 1 - n, 1):
    ans += a[i]
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

a.sort()

total = 0
for i in range(N):
    total += a[N+i]

print(total)

Submission status: Wrong Answer

Solution code:
def getinputdata():

    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

n = int(arr_data[0][0])
arr=[int(arr_data[1][x]) for x in range(n*3)]

arr.sort()

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

inp.sort()
inp.reverse()

i=N
count=0
ans = 0
while(count<N):
    ans += inp[i]
    i += 1
    count += 1

print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest


if __name__ == '__main__':
    n = int(input())
    a = sorted(list(map(int, input().split())), reverse=True)
    print(sum(a[n:2 * n]))

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(map(int,input().split()))
ans=0
for i in range (N):
    ans+=A[i*2+1]
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):
    ans+=A[i+1]
print (ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(input().split())
A.sort(reverse=True)
mean=0
count=0
import sys

for i in range (N):
    mean+=int(A[2*i+1])
print(mean)

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(input().split())
A.sort(reverse=True)
mean=0
count=0
import sys

for i in range (3*N):
    if count==N:
        print(mean)
        sys.exit()
        
    if (i+1)%2==0:
        mean+=int(A[i])
        count+=1

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(input().split())
A.sort(reverse=True)
mean=0
count=0
import sys

for i in range (3*N-1):
    if count==N:
        print(mean)
        sys.exit()
    if (i+1)%2==0:
        mean+=int(A[i])
        count+=1

Submission status: Wrong Answer

Solution code:
N=int(input())
A=list(input().split())
A.sort(reverse=True)
mean=0
count=0
import sys

for i in range (3*N-1):
    if count==10:
        print(mean)
        sys.exit()
    if (i+1)%2==0:
        mean+=int(A[i])
        count+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
a = map(int, input().split())
a_list = list(a)
a_list.sort()
a_list = a_list[::-1]
del a_list[0:N]
print(sum(a_list[0:N]))

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
N = int(input())
b = 3 * N
a = input()
alist = a.split(" ")

sorted(alist)
ans = 0
for i in range(0,N):
    ans += int(alist[3*N - 1 - 2*i])

print(ans)

Submission status: Wrong Answer

Solution code:
N = int(input())
b = 3 * N
a = input()
alist = a.split(" ")

sorted(alist)
ans = 0
for i in range(0,N):
    ans += int(alist[3*N - 1 - 2*i])

print(ans)

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()
for i in range(n):
    del a[i],a[-i]
print(sum(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#bin/usr/env python3

N = int(input())
a = input()
x = 0
b = []

a = a.split()
for i in a:
	b.append(int(i))
b.sort()
for i in range(N):
	x += int(b[2*(i+1)+1])
print(x)

Submission status: Wrong Answer

Solution code:
#bin/usr/env python3

N = int(input())
a = input()
x = 0
b = []

a = a.split()
for i in a:
	b.append(int(i))
print(b)
b.sort()
for i in range(N):
	x += int(b[2*(i+1)+1])
print(x)

Submission status: Wrong Answer

Solution code:
#bin/usr/env python3

N = int(input())
a = input()
x = 0

a = a.split()
a.sort

for i in range(N):
	x += int(a[-(2*i+2)])
print(x)

Submission status: Wrong Answer

Solution code:
#bin/usr/env python3

N = int(input())
a = input()
x = 0

a = a.split()
a.sort

for i in range(N):
	x += int(a[-(2*i+2)])
	
print(x)

Submission status: Wrong Answer

Solution code:
#bin/usr/env python3

N = int(input())
a = input()
x = 0

a = a.split()
a.sort

for i in range(N):
	x += int(a[-(2*i+1)])
	
print(x)

Submission status: Wrong Answer

Solution code:
#bin/usr/env python3

N = int(input())
a = input()
x = 0
z = 3*N

a = a.split()
a.sort

for i in range(N):
	x += int(a[-(2*i+1)])
	
print(x)

Submission status: Wrong Answer

Solution code:
#bin/usr/env python3

N = int(input())
a = input()
x = 0

a = a.split()
a.sort(reverse = True)

z = a[2:3*N+1:-2]

for i in range(len(z)):
	x += int(z[i])
	
print(x)

Submission status: Wrong Answer

Solution code:
#bin/usr/env python3

N = int(input())
a = input()
x = 0

a = a.split()
a.sort()

z = a[2:3*N:2]

for i in range(len(z)):
	x += int(z[i])
	
print(x)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3

N = int(input())
data = input().split(" ")
a = [int(i) for i in data]
sum = 0
a.sort(reverse=True)

for i in a[1:int(N/3*2):2]:
    sum += i

print(sum)

Submission status: Wrong Answer

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

a_s.sort()

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

print(total)

Submission status: Wrong Answer

Solution code:
# -*- coding: UTF-8 -*-
N = int(input())
d = list(map(int,input().split(" ")))
d.sort(reverse = True)
_ans = []
for i in range(N-1):
    _ans.append(d[2*i+1])
print(sum(_ans))

Submission status: Wrong Answer

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

ans = sum(a[N:N*2])

print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque

n = int(input())
a = [int(i) for i in input().split()]
a.sort()
a = deque(a)
for i in range(0,2*n):
    a.popleft()
ans=0
for i in a:
    ans += i
print(ans)

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
N = int(input())
a = sorted(list(map(int, input().split())))
print(sum(a[N+1:2*N+1]))

Submission status: Wrong Answer

Solution code:
N = int(input())
L = input().split(" ")
L.sort(reverse=True)
A = list()
for i in range(N):
    A.append(L[2 * i])
    A.append(L[2 * i + 1])
    A.append(L[(3 * N - 1) - i])

sum = 0
for i in range(N):
    sum += int(A[1 + 3 * i])

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
A = sorted([int(i) for i in input().split()])
A.reverse()
print(sum(A[1:2*N+2:2]))

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    a_list = get_a_list()

    a_list.sort(reverse=True)

    sum_second_a = 0
    
    a_list = a_list[:int(2*N/3)]
    for i in range(1, int(2*N/3), 2):
        sum_second_a += a_list[i]

    print(sum_second_a)

def get_a_list():
    a_list = []
    strs = input().split()

    for a in strs:
        a_list.append(int(a))

    return a_list


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

def main():
    N = int(input())
    a_list = get_a_list()

    a_list.sort(reverse=True)

    sum_second_a = 0
    
    a_list = a_list[:int(2*N/3)]
    for i in range(1, int(2*N/3), 2):
        sum_second_a += a_list[i]

    print(sum_second_a)

def get_a_list():
    a_list = []
    strs = input().split()

    for a in strs:
        a_list.append(int(a))

    return a_list


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

N = int(input())
list_s = input().split(' ')
players = [int(d) for d in list_s]

# N = 2
# players = [5, 2, 8, 5, 1, 5]

players.sort()
# print(players)

sum = 0
for i in range(2, 2*N+1, 2):
    sum += players[i]

print(sum)

Submission status: Wrong Answer

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

P.sort()
res = P[N:3*N-N]

print(str(sum(res)))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
import os

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 = input().split()
b = []
result = 0
for i in range(n):
    b.append([])
for i in range(n * 3):
    a[i] = int(a[i])
a.sort()

count = 0
for i in range(n):
    b[i].append(a[count])
    count += 1
    b[i].append(a[-i-1])
    b[i].append(a[count])
    count += 1
for i in range(len(b)):
    result += b[i][1]
print(result)

Submission status: Wrong Answer

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