Problem:
 Score : 200 points    Problem Statement Snuke is having a barbeque party.  At the party, he will make N servings of Skewer Meal .    Example of a serving of Skewer Meal   He has a stock of 2N skewers, all of which will be used in Skewer Meal. The length of the i -th skewer is L_i .
Also, he has an infinite supply of ingredients.  To make a serving of Skewer Meal, he picks 2 skewers and threads ingredients onto those skewers.
Let the length of the shorter skewer be x , then the serving can hold the maximum of x ingredients.  What is the maximum total number of ingredients that his N servings of Skewer Meal can hold, if he uses the skewers optimally?      Constraints  1≦N≦100  1≦L_i≦100  For each i , L_i is an integer.         Input The input is given from Standard Input in the following format:  N  L_1  L_2  ...  L_{2N}       Output Print the maximum total number of ingredients that Snuke's N servings of Skewer Meal can hold.        Sample Input 1 2
1 3 1 2      Sample Output 1 3  If he makes a serving using the first and third skewers, and another using the second and fourth skewers, each serving will hold 1 and 2 ingredients, for the total of 3 .       Sample Input 2 5
100 1 2 3 14 15 58 58 58 29      Sample Output 2 135

Solution (Python):



import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

n = I()
l = LI()
l.sort()
ans = 0
for i in range(0,2*n,2):
    ans += l[i]
print(ans)

Solution (Python):
input()
l = list(map(int, input().split()))
l.sort()
print(sum([v for i, v in enumerate(l) if i % 2 == 0]))

Solution (Python):
n = int(input())
l = list(map(int, input().split()))

kumi = sorted(l,reverse=True)

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

Solution (Python):
import sys
input = sys.stdin.readline

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

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


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
l = sorted(list(map(int, input().split())))

ans = 0

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

print(ans)

Solution (Python):
n = input()
l = list(map(int,input().split()))
l.sort()
print(sum(l[::2]))

Solution (Python):
n=int(input())
print(sum(sorted(list(map(int,input().split())))[0::2]))

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

Solution (Python):
n=int(input())
L=sorted(list(map(int, input().split())))

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

Solution (Python):
n = int(input())
l = list(map(int,input().split()))

l.sort()

print(sum(l[::2]))

Solution (Python):
N=input()
L=list(map(int,input().split()))

items=0

while(L):

	if L[0]<L[1] :
		s_lg=L[0]
		lg=L[1]
	else:
		s_lg=L[1]
		lg=L[0]

	if len(L)>2:
		for i in range(2,len(L)) :
			if L[i]>=lg:
				s_lg=lg
				lg=L[i]
			elif L[i]>=s_lg :
				s_lg=L[i]

	items=items+s_lg

	L.remove(s_lg)
	L.remove(lg)	

print(items)

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

L.sort()
s = 0

for i in range(len(L) // 2):
    s += L[i * 2]

print(s)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l.sort(reverse=True)
ans = 0

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

print(ans)

Solution (Python):
def main():
    N = int(input())
    L = list(map(int, input().split()))
    L.sort(reverse = True)
    ans = 0
    for i in range(N):
        ans += L[2*i+1]
    return ans

if __name__ == '__main__':
    print(main())

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l = sorted(l)
lSum = 0
for i in range(n):
    lSum += min(l[2 * i], l[2 * i + 1])
print(lSum)

Solution (Python):
import numpy as np
n = int(input())
l = sorted([int(i) for i in input().split()])
l = np.array(l)
print(np.sum(l[np.arange(0,2*n,2)]))

Solution (Python):
n = int(input())
l = sorted(list(map(int, input().split())), reverse=True)
t = 0
for i in range(1, n * 2, 2):
    t += min(l[i], l[i-1])
print(t)

Solution (Python):
import numpy as np
a = input()
c = input().split()

d = [int(i) for i in c]
d.sort()

print(sum(d[0::2]))

Solution (Python):
n = int(input())
l = list(map(int, input().split()))

l.sort()

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

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

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

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
for i in range(2*n):
  if(i%2==0):
    ans += l[i]
print(ans)

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

a.sort()
ans = 0
for i in range(2*n):
	if not i&1:
		ans += a[i]

print(ans)

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L.sort()

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

Solution (Python):
n=int(input())

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

L.sort()

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

Solution (Python):
import sys
input=sys.stdin.readline

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

L.sort()
ans = 0
for i in range(0, 2*N, 2):
    ans += min(L[i],L[i+1])
print(ans)

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

L = sorted(L)

ans = 0
for i in range(0, n*2, 2):
    ans += min(L[i], L[i+1])

print(ans)

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

Solution (Python):
_,a=open(0);print(sum(sorted(map(int,a.split()))[::2]))

Solution (Python):
n = int( input() )
l = list( map( int, input().split() ) )

l.sort()

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

print( sum )

Solution (Python):


n=2*int(input())
l=sorted(list(map(int,input().split())))
cnt=0
for i in range(0,n,2):
    cnt+=min(l[i],l[i+1])
print(cnt)

Solution (Python):
x=input()
y = sorted(list(map(int, input().split())))
i=1
z=0
for i in range(int(len(y)/2)):
     z+=y[-2*i]
     i+=1

print(z)

Solution (Python):

import sys, math, fractions, itertools


def solve(N: int, L: "List[int]"):
    L = sorted(L)
    res = 0
    for i in range(N):
        res += min(L[2*i], L[2*i+1])
    print(res)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    L = [ int(next(tokens)) for _ in range(2*N) ]  
    solve(N, L)

if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
L = list(map(int, input().split()))
L.sort()
array_L = []
for m in [i * 2 for i in range(n)]:
    array_L.append(L[m])
print(sum(array_L))

Solution (Python):
N = int(input())
L = list(map(int,input().split()))

L.sort()
ans=0

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

print(ans)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l = sorted(l, reverse=True)
t = 0
for i in range(1, n * 2, 2):
    t += min(l[i], l[i-1])
print(t)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
ans = 0

a.sort(reverse=True)

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

print(ans)

Solution (Python):
n = int(input())
lst = list(map(int,input().split()))
lst.sort()
s = sum(lst[0::2])
print(s)

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
ans = 0

L.sort(reverse=True)

for i in range(N):
    ans += min(L[2*i], L[2*i+1])
    i += 1

print(ans)

Solution (Python):
input();print(sum(sorted(list(map(int,input().split())))[0::2]))

Solution (Python):
input()
print(sum(sorted(list(map(int,input().split())))[::2]))

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = []

for i in range(0, 2*N, 2):
    ans.append(L[i])

ans = sum(ans)
print(ans)

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

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

Solution (Python):
n = int(input())
l = list(map(int, input().split()))
l.sort()
print(sum([l[i] for i in range(2*n) if i % 2 == 0]))

Solution (Python):


n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
for i in range(2 * n):
    if i % 2 == 0:
        ans += l[i]

print(ans)

Solution (Python):
n=int(input())
l=[int(i) for i in input().split()]
l.sort()
a=0
for i in range(n):
  a+=l[i*2]
print(a)

Solution (Python):
a = int(input())
b = list(map(int, input().split()))
b = sorted(b, reverse=True)
c = 0
for i in range(1, len(b), 2):
    c += min(b[i], b[i-1])
print(c)

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

Solution (Python):
input();print(sum(sorted(list(map(int,input().split())))[0::2]))

Solution (Python):

def main():
    n = int(input())
    L = sorted(map(int, input().rstrip().split()))
    print(sum(L[::2]))


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
l=sorted(list(map(int, input().split())))
ll=l[::2]
print(sum(ll))

Solution (Python):
a = int(input())
b = list(map(int, input().split()))
b = sorted(b, reverse=True)
c = 0
d = 0
for i in range(1, len(b), 2):
    c += min(b[i], b[i-1])
    d += 1
    if d == a:
        break
print(c)

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
l.sort()
x = 0
for i in range(0,n):
    x += min(l[2*i],l[2*i+1])
print(x)

Solution (Python):
import logging

logging.basicConfig(level=logging.INFO, format="%(message)s")


def main():
    N = int(input())
    L_1 = list(map(int, input().split()))

    L_1.sort()

    logging.info(L_1)

    print(sum(L_1[::2]))
    
if __name__ == "__main__":
    main()

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

print (ans)

Solution (Python):

def main():
    num = int(input())
    data = list(map(int, input().split()))
    data.sort()
    ans = sum(data[::2])
    print(ans)



if __name__ == '__main__':
    main()

Solution (Python):
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
    
n=I()
a=LI()
a.sort()

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

print(ans)

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

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

L.sort()

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

print(ans)

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

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

L.sort()
ans = 0
for i in range(0, len(L), 2):
    ans += L[i]
print(ans)

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

Solution (Python):
n=int(input())
l=sorted(list(map(int, input().split())))
ll=l[::2]
print(sum(ll))

Solution (Python):
def main():
    N = int(input())
    L = list(map(int, input().split()))

    L = sorted(L)
    print(sum(L[::2]))

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
vlist = []
ans = 0

for i in range(N):
  a = max(L)
  L.remove(a)
  b = max(L)
  L.remove(b)
  if a < b:
    vlist.append(a)
  else:
    vlist.append(b)

for i in range(N):
  ans += vlist[i]
  
print(ans)

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

print(sum(l[0::2]))

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

Solution (Python):
X = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
for i in range(X):
    ans += min(L[2*i], L[2*i+1])

print(ans)

Solution (Python):
n = input()
l = list(map(int, input().split()))
def bubble_sort(arr):
    change = True
    while change:
        change = False
        for i in range(len(arr) - 1):
            if arr[i] > arr[i + 1]:
                arr[i], arr[i + 1] = arr[i + 1], arr[i]
                change = True
    return arr
ans=[]
L= bubble_sort(l)
k=0
for i in range(0,len(l),2):
    k=k+L[i]
print(k)

Solution (Python):



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

for i in range(N * 2):
    if i % 2 == 0:
        ctr += a[i]
print(ctr)

Solution (Python):
import numpy as np
N =int(input())
input_line2 =(input())
kushisashi_number = list(map(int,np.zeros(N)))

no_kushi = int(N)*2
kushi_length = list(map(int,input_line2.split()))

kushisashi=sorted(kushi_length,reverse=True)
for n in range(N):
    kushisashi_number[n] = kushisashi[2*n+1]
    
print(sum(kushisashi_number))

Solution (Python):
n=int(input())
x=sorted(list(map(int,input().split())))
s=0
for i in range(n):
  s+=x[i*2]
print(s)

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

Solution (Python):
N = int(input())
L = sorted([int(i) for i in input().split()])

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

Solution (Python):
import sys
input = sys.stdin.readline

n = int(input())
l = list(map(int, input().split()))
sum = 0
l.sort()
for i in range(n):
    sum += l[2*i]
print(sum)

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
l.sort()
ans = 0
for i in l[::2]:
    ans +=i
print(ans)

Solution (Python):
N = int(input())
L = list(map(int,input().split()))
L.sort()
ans = 0
i = 0
while(i<2*N):
  ans += L[i]
  i += 2
print(ans)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
l=sorted(l)
s=0
for i in range(len(l)):
  if i%2==0:s+=l[i]
print(s)

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

Solution (Python):
def main():
    N = int(input())
    L = list(map(int, input().split()))
    L.sort()
    ans = sum(L[::2])
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
a = int(input())
b = list(map(int, input().split()))
b.sort()
c = 0
for i in range(len(b)-1, 0, -2):
    c += min(b[i], b[i-1])
print(c)

Solution (Python):
a = int(input())
b = list(map(int, input().split()))
b.sort()
c = 0
for i in range(len(b)-1, 0, -2):
    c += min(b[i], b[i-1])
print(c)

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

print(ans)

Solution (Python):
wood = input()

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

lis_1.sort()

guzai = 0

for i in range(int(wood)):
  max_gu = min(lis_1[2*i],lis_1[2*i+1])
  guzai += int(max_gu)
print(guzai)

Solution (Python):
N = input() 
Inp = list(input().split())
Inp = [int(i) for i in Inp]
Inp.sort()
ans = 0
for i in range(0,len(Inp),2) :
	kushi = [int(Inp[i]),int(Inp[i+1])]
	ans += min(kushi)
print(ans)

Solution (Python):
n=int(input())
k=list(map(int,input().split()))
k.sort()
print(sum(k[::2]))

Solution (Python):
N = int(input())
L = sorted(map(int, input().split()))

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

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
L.sort()

print(sum(L[0::2]))

Solution (Python):
N = int(input())
length = sorted(list(map(int, input().split())))

ans = 0

for i in range(N):
    ans += length[(i*2)]

print(ans)

Solution (Python):
n = int(input())
num_list = [ int(v) for v in input().split() ]
print(sum(sorted(num_list)[::2]))

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

L.sort(reverse=True)

ans = 0

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

print(ans)

Solution (Python):
N = int(input())
*L, = map(int, input().split())
L = sorted(L)
ans = sum(L[::2])
print(ans)

Solution (Python):
n = int(input())
l = [int(i) for i in input().split()]
l.sort()
print(sum([l[i] for i in range(len(l)) if i%2 == 0]))

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

Solution (Python):
N = int(input())
L = sorted(list(map(int, input().split())))

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

Solution (Python):
N = int(input())
L = [int(x) for x in input().split()]
L.sort()

ans = 0
for i in range(N):
  ans += L[i * 2]
  
print(ans)

Solution (Python):
N = int(input())
L = [int(x) for x in input().split()]
L.sort()

ans = 0
for i in range(N):
  ans += L[i * 2]
  
print(ans)

Solution (Python):
N = [int(v) for v in input().split()]
L = [int(v) for v in input().split()]
L.sort()
L_even=L[0::2]
goukei=sum(L_even)
print(str(goukei))

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

Solution (Python):
def BBQ_easy(N: int, L: list)->int:
    L.sort()
    return sum(L[0::2])


if __name__ == "__main__":
    N = int(input())
    L = [int(s) for s in input().split()]

    ans = BBQ_easy(N, L)
    print(ans)

Solution (Python):
N = int(input())
L = [int(x) for x in input().split()]
L.sort()
answer = sum(L[::2])
print(answer)

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
l = sorted(l)
ans = 0
for i in range(len(l)):
    if i%2==0:
        ans += l[i]
print(ans)

Solution (Python):

import sys
def input(): return sys.stdin.readline().rstrip()
def mi(): return map(int, input().split())


N = int(input())
Ks = sorted(list(mi()), reverse=True)

i = 0
ans = 0
while i < (2*N):
  ans += min(Ks[i],Ks[i+1])
  i += 2

print(ans)

Solution (Python):
N=int(input())
L=list(map(int,input().split()))
L.sort()
S=0
for i in L[::2]:
  S=S+i
print(S)

Solution (Python):
n = int(input())
l = list(map(int, input().split()))

ans = 0
l.sort()

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

Solution (Python):
a = int(input())
b = list(map(int,input().split()))
b = sorted(b)
c = 0
for i in range(0,2*a,2):
    c += b[i]
print(c)

Solution (Python):

"""
A - BBQ Easy
https://atcoder.jp/contests/agc001/tasks/agc001_a

"""
import sys


def solve(N, L):
    ans = 0
    while L:
        a = L.pop()
        b = L.pop()
        ans += min(a, b)
    return ans


def main(args):
    N = int(input())
    L = sorted(map(int, input().split()))
    ans = solve(N, L)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):
N = int(input())*2
N -= 1
inp = input()
skewers=[]
for num in inp.split():
    skewers.append(int(num))
skewers = sorted(skewers)
total = 0
for i in range(0,N,2):
  num = int(skewers[i])
  total+=num
print(total)

Solution (Python):
n, = [int(v) for v in input().split()]
l = [int(v) for v in input().split()]

l.sort()

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

Solution (Python):
import sys

def main():
    sinputl = sys.stdin.readline

    num_skewer = int(sinputl().strip())
    input = [int(x) for x in sinputl().split()]
    input.sort()

    count = 0

    for i in range(num_skewer):
        count += input[i * 2]

    print(count)


if __name__ == "__main__":
    main()

Solution (Python):
n=int(input())
l=sorted(map(int,input().split()))
ans=0
while len(l)>1:
    ans+=min(l.pop(),l.pop())
print(ans)

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

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

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
 
L.sort()
s = 0
 
for n in range(N):
    s += L[2*n]
 
print(s)

Solution (Python):
n = int(input())
lis = list(map(int,input().split()))
lis.sort()
S = 0
for i in range(n):
    S += lis[2*i]
print(S)

Solution (Python):
n = int(input())
l = [int(x) for x in input().split()]

l.sort()

cnt = 0
for i in range(2*n):
    if i%2 == 0:
        cnt += l[i]
        
print(cnt)

Solution (Python):
n = int(input())
list_L = list(map(int, input().split()))
list_L.sort()
sum = 0
for i in range(n):
    sum += list_L[2*i]
print(sum)

Solution (Python):
n = int(input())
ls = sorted(list(map(int, input().split())))
print(sum(ls[::2]))

Solution (Python):
num_meals = int(input())
skewers = list(map(int, input().split()))
skewers.sort()
ingredients = 0
for skewer in range(0,(len(skewers) - 1),+2):
    ingredients = ingredients + skewers[skewer]
print(ingredients)

Solution (Python):
num_meals = int(input())
skewers = list(map(int, input().split()))
skewers.sort()
ingredients = 0
for skewer in range(0,(len(skewers) - 1),+2):
    ingredients = ingredients + skewers[skewer]
print(ingredients)

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

Solution (Python):
a = int(input())
b = list(map(int,input().split()))
b.sort()
j = 0
num = 0
for i in range(a):
  c = b[j:j+2]
  num += min(c)
  j += 2
print(num)

Solution (Python):
N = int(input())
L = list(map(int,input().split(" ")))
L.sort()
print(sum(L[::2]))

Solution (Python):
N=int(input())
M=sorted(list(map(int,input().split())))
if N%2==1:
    M.pop(-1)
print(sum(M[::2]))

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

print(sum(sorted(L)[::2]))

Solution (Python):
input()
L=[int(l) for l in input().split()]
L.sort(reverse=True)
print(sum(L[1::2]))

Solution (Python):
N = int(input())
L = [int(i) for i in input().split()]

L.sort()

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

Solution (Python):
N =int(input())
Ls = sorted(map(int,input().split()))
ans = [min(Ls[i+1],Ls[i]) for i in range(0,len(Ls)-1,2)]
print(sum(ans))

Solution (Python):
N = int(input())

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

s.sort()

sum = 0

for i in range(N):
  sum = sum + s[2*i]

print(sum)

Solution (Python):
n=input()
a=input().split()
a=[int(i) for i in a]
a.sort()
count=0
ans=0
for i in a:
  if count%2==0:
    ans+=i
  count+=1
print(ans)

Solution (Python):


import sys

L = [input()]
L = sorted(list(map(int,input().split())), key= lambda x: -x)
test = lambda L, S=0, f=lambda f, L, S : f(f,L[2:],S+L[1]) if L else print(S): f(f, L, S)
test(L)

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

Solution (Python):
N=input().split()
L_i = list(map(int, input().split()))

L_i.sort(reverse=False)

print(sum(L_i[0::2]))

Solution (Python):
n = int(input()) * 2
l = input().split()
s = []
for i in range(n):
  s.append(int(l[i]))
s.sort(reverse=True)
sum  = 0
for qq in range(1,n,2):
  sum = sum + s[qq]
  
print(sum)

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
 
L_s = sorted(L)
A = sum(L_s[0::2])
 
print(A)

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
 
L_s = sorted(L)
A = sum(L_s[0::2])
 
print(A)

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
res = 0
L.sort()
for i in range(len(L)%2, len(L), 2):
    res += L[i]

print(res)

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
ans=0
b=[]
for k in range(2*n):
 for i in range(2*n):
  if a[i]==min(a):
    b.append(a[i])
    a[i]=101
for s in range(n):
  ans+=b[2*s]
print(ans)

Solution (Python):
N=int(input())
L=[int(i) for i in input().split()]
L.sort()
K=[]
for i in range(N):
    K.append(L[i*2])

print(sum(K))

Solution (Python):
li = []
N = int(input())
li = list(map(int, input().split()))

li.sort(reverse=True)
re = sum(li[1::2])
print(re)

Solution (Python):
n=int(input())
l=[int(i) for i in input().split()]
l.sort()
ans=0
for i in range(2*n):
    if i%2==0:
        ans+=l[i]
print(ans)

Solution (Python):
n = int(input())
li = list(map(int,input().split()))
li.sort()
print(sum(li[::2]))

Solution (Python):
n=int(input())
l=[int(i) for i in input().split()]
l.sort()
ans=0
for i in range(2*n):
    if i%2==0:
        ans+=l[i]
print(ans)

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
l = sorted(L)
cnt = 0
for i in range(N):
  cnt += l[2*i]
print(cnt)

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

Solution (Python):
N = int(input())
L = sorted(list(map(int,input().split())))

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

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())
L = [int(v) for v in input().split()]

L.sort()
ans = 0
for i in range(N):
    ans += min(L[i * 2], L[i * 2 + 1])
    
print(ans)

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

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

Solution (Python):
N = int(input())
L = list(map(int, input().split()))

L.sort()

ans = 0
for i in range(2*N):
    if i % 2 == 0:
        ans += L[i]

print(ans)

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

res =[]
for i in range(N):
    res.append(a[2*i])

print(sum(res))

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

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

Solution (Python):


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

l.sort()

ans = 0
for i in range(0,len(l),2):
    ans += l[i]

print(ans)

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

Solution (Python):

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

Ls.sort(reverse=True)
res = sum(Ls[1::2])

print(res)

Solution (Python):
n=int(input())
A=sorted(list(map(int,input().split())))
print(sum(A[::2]))

Solution (Python):
N =int(input())
L =[int(j) for j in input().split()]
L.sort()
ans=0
for i in range(0,2*N-1,2):
    ans+=min(L[i:i+2])
print(ans)

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

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
l.sort(reverse=True)
c=0
for i in range(1,2*n,2):
    c+=l[i]
print(c)

Solution (Python):
N = int(input())
tmp_lst = input().split()
length_lst = []

for i in range(2*N):

    length_lst.append(int(tmp_lst[i]))
length_lst.sort()
 
output = 0
for i in range(0, 2*N, 2):
    output += length_lst[i]
 
print(output)

Solution (Python):
N = int(input())
lList = [int(x) for x in input().split()]

lList.sort()

result = 0
for l, ll in zip(lList[::2], lList[1::2]):
    result += min(l,ll)

print(result)

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

Solution (Python):
n = input()
L = [int(_) for _ in input().split()]
L.sort()

total = 0

for i in range(len(L)):
    if i % 2 == 0:
        total += L[i]
        
print(total)

Solution (Python):
N = int(input())
L = list(map(int, input().split()))
L.sort()

sum = 0
for i in range(N * 2):
  if i % 2 == 1:
    sum += min(L[i-1], L[i])

print(sum)

Solution (Python):
n=int(input())
arr=list(map(int,input().split()))
arr=sorted(arr)
ans=0
for i in range(len(arr)):
  if i%2==0:
    ans+=arr[i]
print(ans)

Solution (Python):
n = int(input())
l = [int(i) for i in input().split()]
l.sort()

cnt=0
for i in range(n):
    cnt += l[2*i]

print(cnt)

Solution (Python):
N = int(input())

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

L.sort()

ans = 0
for i in range(0, len(L), 2):
    ans += L[i]

print(ans)

Solution (Python):
n = int(input())
kushi = list(map(int, input().split()))
kushi.sort()
setkushi = [min(kushi[2*i], kushi[2*i+1]) for i in range(n)]
print(sum(setkushi))

Solution (Python):
N = int(input())
L = [int(i) for i in input().split()]
L.sort()
L = L[0::2]
print(sum(L))

Solution (Python):
n,l=open(0);print(sum(sorted(map(int,l.split()))[::2]))

Solution (Python):
import math
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def zeros(n): return [0]*n
def zeros2(n, m): return [zeros(m) for i in range(n)] 

class Debug():
    def __init__(self):
        self.debug = True
 
    def off(self):
        self.debug = False
 
    def dmp(self, x, cmt=''):
        if self.debug:
            if cmt != '':
                w = cmt + ': ' + str(x)
            else:
                w = str(x)
            print(w)
        return x

def prob():  
    d = Debug()
    d.off()
    N = getInt()
    d.dmp((N), 'N')
    L = getIntList()
    d.dmp((L), 'L')
    L.sort()
    count = 0
    for i in range(N):
        count += min(L[i*2], L[i*2+1])
    return count


ans = prob()
print(ans)

Solution (Python):
N = input()
L = list(map(int, input().split()))

def quicksort(array):
    if len(array) < 2:
        return array
    else:
        pivot = array[0]
        less = [i for i in array[1:] if i <= pivot]
        greater = [i for i in array[1:] if i > pivot]
        return quicksort(less) + [pivot] + quicksort(greater)

guzai = 0

for i in range(int(N)):
    guzai += int(quicksort(L)[int(2*i)]) 

print (guzai)

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

Solution (Python):
N = int(input())
Ls = [int(x) for x in input().split()]

Ls.sort()
ans = 0
for i in range(0, len(Ls), 2):
    ans += min(Ls[i], Ls[i + 1])

print(ans)

Solution (Python):
N = int(input())
c=list(map(int, input().split()))
c.sort()
Max = 0
for i in range(len(c)):
    if i%2 == 0:
        Max = Max + c[i]
    else:
        None
print(Max)

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

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

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

Solution (Python):
N=int(input())
L=list(map(int, input().split()))

L.sort()

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

print(sum)

Solution (Python):


N = int(input())
L = []
for n in [int(i) for i in input().split()]:
    L.append(n)

L.sort()
SUM = 0
for i in range(N):
    x = L.pop()
    y = L.pop()
    if x < y:
        SUM = SUM + x
    elif x >= y:
        SUM = SUM + y

print(SUM)

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

Solution (Python):
n = int(input())
s = list(map(int,input().split()))
s.sort()
sum = 0

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

Solution (Python):
import bisect

N = input()
Ls = map(int,input().split(" "))
Ls = sorted(Ls)
ans = sum([L for i,L in enumerate(Ls) if i%2 == 0])
print(ans)

Solution (Python):
input();print(sum(sorted(list(map(int,input().split())))[-2::-2]))

Solution (Python):
n = int(input())
L = sorted(list(map(int, input().split())))
ans = 0

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