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 = sorted(a)[::-1]
ans = sum(a[:2*n:2])
print(ans)

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.sort()
ans = 0
for i in range(n):
    ans += a[i+n]
print(ans)

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import numpy as np

def main():
    numbers=[]
    dp=[]
    n = int(input())
    numbers=np.array(list(map(int,input().split())),dtype=int)
    numbers.sort()
    t1,t2,t3=np.hsplit(numbers,3)
    print(t2.sum())

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline

def main():
    numbers=[]
    dp=[]
    n = int(input())
    numbers=list(map(int,input().split()))
    numbers.sort()
    print(sum(numbers[n:n*2]))

if __name__=="__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())

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

a = sorted(a, reverse=True)



SUM = 0

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

Submission status: Wrong Answer

Solution code:
N = int(input())
n = list(map(int,input().split()))
n = sorted(n,reverse=True)
print(sum(n[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(N):
    a.pop()
    
a = sorted(a, reverse=True)

SUM = 0

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

print(SUM)

Submission status: Wrong Answer

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

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

for i in range(1, N+1):
    Z = Z + a[i]
    
print(Z)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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+1 : 2*n+1]))

Submission status: Wrong Answer

Solution code:
# row = [int(x) for x in input().rstrip().split(" ")]
# n = int(input().rstrip())
# s = input().rstrip()

def resolve():
    import sys
    input = sys.stdin.readline

    n = int(input().rstrip())

    a_list = [int(x) for x in input().rstrip().split(" ")]
    a_list.sort()

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


if __name__ == "__main__":
    resolve()

Submission status: Wrong Answer

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

cnt = 0
a.sort(reverse=True)
print(a)

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

print(cnt)

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(reverse=True)
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, 2 * N):
    ans += a[i]
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque

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

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

Submission status: Wrong Answer

Solution code:
from collections import deque

n = int(input())
a = [int(x) for x in input().split()]
a.sort()
a = deque(a)

result = 0
for _ in range(n):
  a.popleft()
  a.pop()
  centor_v = list(a)[len(a)//2]
  a.remove(centor_v)
  result += centor_v
print(result)

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

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):
    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(sum(a[N:N+N]))

Submission status: Wrong Answer

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

power = 0
for i in range(N):
  power += power_list[i+1]

print(power)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(sum(a[n:n+n:]))

Submission status: Wrong Answer

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

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())))
second = []
ans = 0
for i in range(N, 2*N):
    second.append(a[i])
ans = sum(second)
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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(reverse=True)

answer = 0
for i in reversed(range(1, N+1)):
  answer += A[i+1]

print(str(answer))

Submission status: Wrong Answer

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

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()))
ls = [[] for i in range(N)]
A.sort()
for i in range(3*N):
    ls[i%N].append(A[i])
ans = 0
for i in range(len(ls)):
    k = ls[i]
    k.sort()
    ans += k[1]
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 = [int(an) for an in input().split()]
a.sort(reverse=True)
print(sum(a[n: 2*n]))

Submission status: Wrong Answer

Solution code:
#
# agc012 a
#

import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2
5 2 8 5 1 5"""
        output = """10"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """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"""
        output = """10000000000"""
        self.assertIO(input, output)


def resolve():
    N = int(input())
    a = list(map(int, input().split()))
    a.sort()
    for i in range(N):
        a.pop()
        a.pop(0)
    print(sum(a))


if __name__ == "__main__":
    # unittest.main()
    resolve()

Submission status: Wrong Answer

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

a.sort()

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

print(sum(a))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

	a.sort()

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


  
if __name__ == "__main__":
  	main()

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 = list(map(int, input().split()))
 
a.sort()
 
C = []
for i in range(N):
  C.append([])
 
for i in range(3*N):
  k = i % N
  C[k].append(a[i])
 
power = []
for i in range(N):
  power.append(C[i][1])
 
print(sum(power))

Submission status: Wrong Answer

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

a.sort(reverse = True)

C = []
for i in range(N):
  C.append([])

for i in range(3*N):
  k = i % N
  C[k].append(a[i])

power = []
for i in range(N):
  power.append(C[i][1])

print(sum(power))

Submission status: Wrong Answer

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

lis  =sorted(lis)


t1 = lis[n:2*n]
#print(sum(t1))

nlis = lis[::-1]

t2 = 0
for i in nlis[1:0:3]:
    t2 += i

print(max(sum(t1), t2))

Submission status: Wrong Answer

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

lis  =sorted(lis)

t = lis[n:2*n]
print(sum(t))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

lists = [[] for _ in range(N)]
while len(an) > 0:
    for k in range(N):
        lists[k].append(min(an))
        del an[an.index(min(an))]

sasa = 0
for j in range(N):
    sasa += lists[j][1]
print(sasa)

Submission status: Wrong Answer

Solution code:
# AGC 012 A - AtCoder Group Contest
N = int(input())
an = list(map(int,input().split()))

ak = []
while len(an) > 0:
    ak.append(min(an))
    del an[an.index(min(an))]

lists = [[] for _ in range(N)]
while len(ak) > 0:
    for k in range(N):
        lists[k].append(min(ak))
        del ak[ak.index(min(ak))]

sasa = 0
for j in range(N):
    sasa += lists[j][1]
print(sasa)

Submission status: Wrong Answer

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

print(sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(sum(ans))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = int(input())
participants = sorted([ int(v) for v in input().split(" ") ])

# 1 2 4 5 5 5 7 8 9 
# 1 2 5 5 5 8

sum = 0
i = 0
for p in participants[N:]:
  sum += p
  i += 1
  if i == N:
    break
  #print(v[i])

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
participants = sorted([ int(v) for v in input().split(" ") ], reverse=True)

# 1 2 4 5 5 5 7 8 9 
# 1 2 5 5 5 8

sum = 0
i = 0
for p in participants[N:]:
  sum += p
  i += 1
  if i == N:
    break
  #print(v[i])

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
v = sorted([ int(v) for v in input().split(" ") ])

# 1 2 4 5 5 5 7 8 9 

sum = 0
for i in range(N, 2*N):
  sum += v[i]
  #print(v[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,*aa=map(int, open(0).read().split())

aa.sort(reverse=True)

sum(aa[1::2][:n])

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

Submission status: Wrong Answer

Solution code:
import heapq

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

ans = 0
b = list(map(lambda x: x * (-1), a))
heapq.heapify(b)
for _ in range(N):
    heapq.heappop(b)
for _ in range(N):
    ans -= heapq.heappop(b)
print(ans)

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:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
fact = math.factorial
sys.setrecursionlimit(10**9)
INF = 10**9
mod = 10**9+7

N = i()
a = l()
a.sort()
print(sum(a[N+1:3*N-N+1]))

Submission status: Wrong Answer

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

a.sort(reverse=True)
print(sum(a[int(n/3):int(n/3*2)]))

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = list(map(int, input().split()))
arrr = arr.sort(reverse=True)
ans = sum(arr[n:n + n])
print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

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())
ai=list(map(int,input().split()))
ai.sort()
ans1=ai[N:]
ans2=ans1[:N]

print(sum(ans2))

Submission status: Wrong Answer

Solution code:
N=int(input())
ai=list(map(int,input().split()))
ai.sort()
ans1=ai[N:]
ans2=ans1[:N]

print(ans1)
print(ans2)

print(sum(ans2))

Submission status: Wrong Answer

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

ans1=ai[N:]
ans2=ans1[:N]

print(sum(ans2))

Submission status: Wrong Answer

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

a = sorted(a)
m1 = n # // 3
m2 = 2 * m1
print(sum(a[n:2 * n]))

Submission status: Wrong Answer

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

a = sorted(a)
m1 = n // 3
m2 = 2 * m1
print(sum(a[m1:m2]))

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
n=int(input())

a_list=[int(i) for i in input().split()]
a_list.sort()
#print(len(a_list))
#print(a_list)
print(sum(a_list[n:2*n]))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

print(a[1:N*2:3])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N = i()
a = l()
a.sort()
A = len(a)
for i in range(A-N,N,-1):
    ans += a[i-1]

print(ans)

Submission status: Wrong Answer

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def i(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0

N = i()
a = l()
a.sort()
A = len(a)
for i in range(A-N,N,-1):
    ans += a[i]

print(ans)

Submission status: Wrong Answer

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

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

print(total)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy


if __name__ == "__main__":
    n = int(input())
    a = list(map(int,input().split()))
    a.sort()
    ans = [[] for i in range(n)]
    for i in range(3*n):
        ans[i%n].append(a[i])
    f_ans = 0
    for i in range(n):
        f_ans += ans[i][len(ans[i])//2]
    print(f_ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy


if __name__ == "__main__":
    n = int(input())
    a = list(map(int,input().split()))
    a.sort(reverse= True)
    ans = [[] for i in range(n)]
    for i in range(3*n):
        ans[i%n].append(a[i])
    f_ans = 0
    for i in range(n):
        f_ans += ans[i][1]
    print(f_ans)

Submission status: Wrong Answer

Solution code:
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
import copy


if __name__ == "__main__":
    n = int(input())
    a = list(map(int,input().split()))
    a.sort()
    ans = [[] for i in range(n)]
    for i in range(3*n):
        ans[i%n].append(a[i])
    f_ans = 0
    for i in range(n):
        f_ans += ans[i][1]
    print(f_ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import sys

input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)


def main():
    N = int(input())
    A = sorted(list(map(int, input().split())), reverse=True)

    # print(A)

    ans = 0
    for i in range(N):
        ans += A[i + N]

    print(ans)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
N = int(input())
lis = sorted(list(map(int, input().split())))
ans = 0

for i in range(N, 0, -1):
    ans += lis[i*2]

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

    return
resolve()

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.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())),reverse=True)
print(sum(a[N:2*N]))

Submission status: Wrong Answer

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

a.sort()
point_sum = 0


for i in range(n):
    point_sum += a[n + i]

print(point_sum)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())))
ans = 0
for i in range(n, n*3):
    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()

b=sum(a[n:-n])
c=0
for i in range(n):
	c += a[-2 - 3*i]
print(max(b,c))

Submission status: Wrong Answer

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

b=sum(a[n:-n])
c=0
for i in range(n):
	c += a[1 + 3*i]
print(max(b,c))

Submission status: Wrong Answer

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

b=a[n:-n]
print(sum(b))

Submission status: Wrong Answer

Solution code:
N = int(input())
a = [0] + list(map(int, input().split()))
a = sorted(a)
print(sum(a[len(a) // 3 + 1: len(a) // 3 * 2 + 1]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(sum([a[2*i-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[3*i-2] for i in range(N)]))

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 += int(a[3*i+1])

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

if ans > ans2:
    print(ans)
else:
    print(ans2)

Submission status: Wrong Answer

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

a.sort(reverse=True)

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

print(ans)

Submission status: Wrong Answer

Solution code:
## A - AtCoder Group Contest
N = int(input())
A = map(int, input().split())
A = sorted(A)
print(sum(A[N:2*N]))

Submission status: Wrong Answer

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

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N, *A = map(int, read().split())

A = sorted(A)
A = A[N:-N]

print(sum(A))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

print(ans)

Submission status: Wrong Answer

Solution code:
N=int(input())
a_list=list(map(int,input().split()))
a_list=sorted(a_list)[::-1]
power=[]
print(a_list)
for i in range(N):
    power.append(a_list[2*i+1])
print(sum(power))

Submission status: Wrong Answer

Solution code:
N=int(input())
a_list=list(map(int,input().split()))
a_list=sorted(a_list)[::-1]
power=[]
print(a_list)
for i in range(N):
    power.append(a_list[2*i+1])
print(sum(power))

Submission status: Wrong Answer

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

sorted_a = sorted(a_list)

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#整数の入力
N = int(input())

#スペース区切りの整数の入力リスト
A_list = list(map(int, input().split()))

A_list = list(reversed(sorted(A_list)))
print(A_list)



ans  = 0
for i in range(1,2*N,2):
  #print(i)
  #print(A_list[i])
  ans = ans + A_list[i]
print(ans)

Submission status: Wrong Answer

Solution code:
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N = I()
a = sorted(LI())
print(sum(a[N:2*N]))

Submission status: Wrong Answer

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

a_list.sort(reverse=True)

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

print(sum)

Submission status: Wrong Answer

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

a_list.sort(reverse=True)
print(a_list)

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

print(sum)

Submission status: Wrong Answer

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

a_list.sort(reverse=True)

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

print(sum)