Problem:


 コンテスト 

問題

先日，オンラインでのプログラミングコンテストが行われた． W大学とK大学のコンピュータクラブは以前からライバル関係にあり，このコンテストを利用して両者の優劣を決めようということになった．

今回，この2つの大学からはともに10人ずつがこのコンテストに参加した．長い議論の末，参加した10人のうち，得点の高い方から3人の得点を合計し，大学の得点とすることにした．

W大学およびK大学の参加者の得点のデータが与えられる．このとき，おのおのの大学の得点を計算するプログラムを作成せよ． 

入力

入力は20行からなる． 1行目から10行目にはW大学の各参加者の得点を表す整数が， 11行目から20行目にはK大学の各参加者の得点を表す整数が書かれている．これらの整数はどれも0以上100以下である．

出力

W大学の得点とK大学の得点を，この順に空白区切りで出力せよ．

入出力例

入力例１
  

  

23
23
20
15
15
14
13
9
7
6
25
19
17
17
16
13
12
11
9
5

出力例１

  
   

66 61

入力例２
  

17
25
23
25
79
29
1
61
59
100
44
74
94
57
13
54
82
0
42
45

出力例２

   

240 250

上記問題文と自動審判に使われるデータは、情報オリンピック日本委員会が作成し公開している問題文と採点用テストデータです。



Sample input:
23
23
20
15
15
14
13
9
7
6
25
19
17
17
16
13
12
11
9
5


Sample output:
66 61

Submission status: Wrong Answer

Solution code:
W = []
K = []

for i in range(10):
    W.append(int(input()))

for i in range(10):
    K.append(int(input()))

W.sort(reverse=True)
K.sort(reverse=True)

print(W[0] + W[1] + W[2])
print(K[0] + K[1] + K[2])

Submission status: Wrong Answer

Solution code:
w = []; k = [];
for i in range(10):
    w += [input()]
for i in range(10):
    k += [input()]
print reduce(lambda a,x:a+x, sorted(w)[7:])
print reduce(lambda a,x:a+x, sorted(k)[7:])

Submission status: Wrong Answer

Solution code:
def main():
    a = []
    b = []
    for _ in range(10):
        a.append(int(input()))
    for _ in range(10):
        b.append(int(input()))
    a_sum = 0
    b_sum = 0
    for x in a:
        a_sum += x
    for x in b:
        b_sum += x
    print(a_sum, b_sum)


if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def func():
  lst = []
  for i in range(10):
    lst.append(int(input()))
  lst.sort()
  print(sum(lst[-3:]))
func()
func()

Submission status: Wrong Answer

Solution code:
W=sorted([input() for i in range(10)])
K=sorted([input() for i in range(10)])
print sum(W[:3]),sum(K[:3])

Submission status: Wrong Answer

Solution code:
import sys

l = [int(s) for s in sys.stdin]
w = sorted(l[0:10])[:-4:-1]
k = sorted(l[10:20])[:-4:-1]
print w, k

Submission status: Wrong Answer

Solution code:
w, k = [],[]
for i in range(10):
    w.append(i)
for i in range(10):
    k.append(i)
print sum(sorted(w)[:-3]),sum(sorted(k)[:-3])

Submission status: Wrong Answer

Solution code:
w, k = [],[]
for i in range(10):
    w.append(i)
for i in range(10):
    k.append(i)
print sum(sorted(w)[-3:]),sum(sorted(k)[-3:])

Submission status: Accepted

Solution code:
w = [int(input()) for i in range(10)]
k = [int(input()) for i in range(10)]
w.sort()
k.sort()
print(sum(w[-3:]),sum(k[-3:]))

Submission status: Accepted

Solution code:
W = []
K = []

for i in range(10):
    W.append(int(input()))

for i in range(10):
    K.append(int(input()))

W.sort(reverse=True)
K.sort(reverse=True)

print(W[0] + W[1] + W[2] , K[0] + K[1] + K[2])

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

w = []
k = []

for _ in range(10):
    w.append(int(input()))

for _ in range(10):
    k.append(int(input()))

w_sum = sum(sorted(w)[7:])
k_sum = sum(sorted(k)[7:])

print(w_sum, k_sum)

Submission status: Accepted

Solution code:
w = []; k = [];
for i in range(10):
    w += [input()]
for i in range(10):
    k += [input()]
print reduce(lambda a,x:a+x, sorted(w)[7:]), reduce(lambda a,x:a+x, sorted(k)[7:])

Submission status: Accepted

Solution code:
x = []
for i in range(20):
    x += [input()]
print sum(sorted(x[:11])[-3:]), sum(sorted(x[11:])[-3:])

Submission status: Accepted

Solution code:
print(*(sum(sorted(int(input()) for _ in range(10))[-3:]) for _ in (0, 0)))

Submission status: Accepted

Solution code:
W = []
for w in range(10):
    w = int(input())
    W.append(w)
K = []
for k in range(10):
    k = int(input())
    K.append(k)
W.sort()
K.sort()
a1 = W[7] + W[8] + W[9]
a2 = K[7] + K[8] + K[9]
print(a1,a2)

Submission status: Accepted

Solution code:
W = [int(input()) for _ in range(10)]
K = [int(input()) for _ in range(10)]
print(sum(sorted(W)[-3:]),sum(sorted(K)[-3:]))

Submission status: Accepted

Solution code:
w = [] 
k = [] 
 
for i in range(10): 
  w.append(int(input())) 
for i in range(10): 
  k.append(int(input())) 
 
w.sort() 
k.sort() 
 
print(sum(w[7:]), sum(k[7:]))

Submission status: Accepted

Solution code:
print(sum(sorted([int(input()) for _ in range(10)])[7:10]),sum(sorted([int(input()) for _ in range(10)])[7:10]))

Submission status: Accepted

Solution code:
print(*(sum(sorted([int(input()) for _ in range(10)])[-3:]) for _ in range(2)))

Submission status: Accepted

Solution code:
wk = [int(input()) for _ in range(20)]
print(sum(sorted(wk[:10])[7:]), sum(sorted(wk[10:])[7:]))

Submission status: Accepted

Solution code:
wsd = []
ko = []

for i in range(10):
    wsd.append(int(input()))
for i in range(10):
    ko.append(int(input()))
wsd.sort()
ko.sort()

print(sum(wsd[7:]),sum(ko[7:]))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0533

"""
import sys
from sys import stdin
input = stdin.readline

def main(args):
    W_scores = [int(input()) for _ in range(10)]
    K_scores = [int(input()) for _ in range(10)]
    W_scores.sort()
    K_scores.sort()

    W_sum = sum(W_scores[-3:])
    K_sum = sum(K_scores[-3:])
    print(W_sum, K_sum)


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

Submission status: Accepted

Solution code:
def main():
    a = []
    b = []
    for _ in range(10):
        a.append(int(input()))
    for _ in range(10):
        b.append(int(input()))
    a.sort(reverse = True)
    b.sort(reverse = True)

    aa = 0
    bb = 0
    for x in range(3):
        aa += a[x]
        bb += b[x]

    print(aa, bb)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
w=sorted([int(input())for i in range(10)],reverse=True)
k=sorted([int(input())for i in range(10)],reverse=True)
pt=[str(w[0]+w[1]+w[2]),str(k[0]+k[1]+k[2])]
print(" ".join(pt))

Submission status: Accepted

Solution code:
from collections import deque
wuniversity = deque([])
for i in range(20):
    wuniversity.append(int(input()))

kuniversity = deque([])
for i in range(10):
    kuniversity.append(wuniversity.pop())

kuniversity = sorted(kuniversity)
wuniversity = sorted(wuniversity)

print(wuniversity[-1]+wuniversity[-2]+wuniversity[-3], end=' ')
print(kuniversity[-1]+kuniversity[-2]+kuniversity[-3])

Submission status: Accepted

Solution code:
W = [int(input()) for i in range(10)]
K = [int(input()) for j in range(10)]
W.sort(reverse=True)
K.sort(reverse=True)
Sum_W = sum(W[0:3])
Sum_K = sum(K[0:3])
print(Sum_W,Sum_K)

Submission status: Accepted

Solution code:
W = [int(input()) for i in range(10)]
K = [int(input()) for i in range(10)]

W_sorted = sorted(W)
K_sorted = sorted(K)

W_top_three = sum(W_sorted[7:])
K_top_three = sum(K_sorted[7:])

print("{} {}".format(W_top_three, K_top_three))

Submission status: Accepted

Solution code:
def main():
    w = []
    for i in range(10):
        w.append(int(input()))
    k = []
    for i in range(10):
        k.append(int(input()))
    print(sum(sorted(w, reverse=True)[:3]), sum(sorted(k, reverse=True)[:3]))
        

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
def func():
  lst = []
  for i in range(10):
    lst.append(int(input()))
  lst.sort()
  return sum(lst[-3:])
print(func(),func())

Submission status: Accepted

Solution code:
print(*[sum(sorted(int(input())for _ in[0]*10)[7:])for _ in'12'])

Submission status: Accepted

Solution code:
# AOJ 0533: Contest
# Python3 2018.6.30 bal4u

s = [0]*2
for i in range(2):
	s[i] = sum(sorted([int(input()) for j in range(10)], reverse=True)[:3])
print(s[0], s[1])

Submission status: Accepted

Solution code:
b,c=[],[]
for i in range(10):
  a=int(input())
  b.append(a)
else: b.sort()
for i in range(10):
  a=int(input())
  c.append(a)
else: c.sort()
ans,ans2=0,0
for i in range(9,6,-1):
  ans+=b[i]
  ans2+=c[i]
else: print ans,ans2

Submission status: Accepted

Solution code:
import sys
R = lambda:map(int,raw_input().split())

n = 10
w = []
k = []
scoreW = 0
scoreK = 0
for i in xrange(n):
    w.append(int(raw_input()))
for i in xrange(n):
    k.append(int(raw_input()))
w.sort(reverse=True)
k.sort(reverse=True)

m = 3
for i in xrange(m):
    scoreW += w[i]
    scoreK += k[i]

print scoreW, scoreK

Submission status: Accepted

Solution code:
W=sorted([input() for i in range(10)],reverse=True)
K=sorted([input() for i in range(10)],reverse=True)
print sum(W[:3]),sum(K[:3])

Submission status: Accepted

Solution code:
import sys

l = [int(s) for s in sys.stdin]
w = sum(sorted(l[0:10])[:-4:-1])
k = sum(sorted(l[10:20])[:-4:-1])
print w, k

Submission status: Accepted

Solution code:
w, k = [],[]
for i in range(10):
    w.append(int(raw_input()))
for i in range(10):
    k.append(int(raw_input()))
print sum(sorted(w)[-3:]),sum(sorted(k)[-3:])

Submission status: Accepted

Solution code:
a = []
for i in range(20):
    a.append(int(raw_input()))
print sum(sorted(a[:11])[-3:]),sum(sorted(a[11:])[-3:])

Submission status: Accepted

Solution code:
W = []
for w in range(10):
    w = int(input())
    W.append(w)

K = []
for k in range(10):
    k = int(input())
    K.append(k)

W.sort()
K.sort()
w = W[7] + W[8] + W[9]
k = K[7] + K[8] + K[9]
print(w,k)

Submission status: Accepted

Solution code:
s = [0]*2
for i in range(2):
	s[i] = sum(sorted([int(input()) for j in range(10)], reverse=True)[:3])
print(s[0], s[1])

Submission status: Accepted

Solution code:
print(*(sum(sorted([int(input()) for _ in range(10)])[-3:]) for _ in range(2)))

Submission status: Accepted

Solution code:
w=[int(input()) for i in range(10)]
k=[int(input()) for i in range(10)]

wsum=sum(sorted(w)[7:])
ksum=sum(sorted(k)[7:])
print(wsum,ksum)

Submission status: Accepted

Solution code:
a=[]
b=[]

for i in range (10):
    c=int(input())
    a.append(c)
    d=sorted(a)
    
for i in range (10):
    c=int(input())
    b.append(c)
    e=sorted(b)

print(d[-1]+d[-2]+d[-3],e[-1]+e[-2]+e[-3])

Submission status: Accepted

Solution code:
a,b = [],[]

for i in range(10):
    a.append(int(input()))
    
for i in range(10):
    b.append(int(input()))
    
a.sort(reverse=True)
b.sort(reverse=True)

print(a[0]+a[1]+a[2],b[0]+b[1]+b[2])

Submission status: Accepted

Solution code:

a=[]
b=[]
A=[]
B=[]
for i in range(20):
    if i<=9:
        a.append(int(input()))
    else:
        b.append(int(input()))
        
for n in range(3):
    s=max(a)
    A.append(s)
    a.remove(s)

        
for m in range(3):
    t=max(b)
    B.append(t)
    b.remove(t)
    
print(sum(A),sum(B))

Submission status: Accepted

Solution code:
W = []
K = []
for i in range(10):
    W.append(int(input()))
    W.sort()
    W.reverse()
for i in range(10):
    K.append(int(input()))
    K.sort()
    K.reverse()
print(sum(W[0:3]),sum(K[0:3]))

Submission status: Accepted

Solution code:
a = []
for i in range(10):
    n = int(input())
    a.append(n)
    a.sort(reverse=True)

b = []
for i in range(10):
    m = int(input())
    b.append(m)
    b.sort(reverse=True)
    
print('{} {}'.format(a[0]+a[1]+a[2],b[0]+b[1]+b[2]))

Submission status: Accepted

Solution code:

x=[int(input()) for i in range(20)]

a=x[0:10]
b=sorted(a)
del b[0:7]

c=x[10:]
d=sorted(c)
del d[0:7]

print(sum(b),sum(d))

Submission status: Accepted

Solution code:
n=[int(input()) for i in range(10)]
m=[int(input()) for j in range(10)]
n.sort()
n.reverse()
m.sort()
m.reverse()
w=sum(n[0:3])
k=sum(m[0:3])
print(w,k)

Submission status: Accepted

Solution code:
A=[int(input()) for i in range(10)]
B=[int(input()) for r in range(10)]
A.sort(reverse=True)
B.sort(reverse=True)
C=sum(A[:3])
D=sum(B[:3])
print(int(C),int(D))

Submission status: Accepted

Solution code:
W=[]
K=[]
for i in range(10):
    W.append(int(input()))
for i in range(10):
    K.append(int(input()))
W.sort()
K.sort()
print(W[7]+W[8]+W[9],K[7]+K[8]+K[9])

Submission status: Accepted

Solution code:
W= [int(input()) for i in range(10)]
K= [int(input()) for i in range(10)]
W.sort(reverse = True)
K.sort(reverse = True)
print(sum(W[:3]),sum(K[:3]))

Submission status: Accepted

Solution code:
list_W = []
list_K = []

for i in range(10) :
    list_W.append(int(input()))
for i in range(10) :
    list_K.append(int(input()))

list_W.sort(reverse = True)
list_K.sort(reverse = True)

sum_W = sum(list_W[0:3])
sum_K = sum(list_K[0:3])

print(sum_W, sum_K)

Submission status: Accepted

Solution code:
a = []
b = []
for i in range(0,10):
    n = int(input())
    a.append(n)
    a.sort()
    W = a[7:10]
for i in range(10,20):
    n = int(input())
    b.append(n)
    b.sort()
    c = b[7:10]
print(sum(W),sum(c))

Submission status: Accepted

Solution code:
W=[int(input()) for i in range(10)]
K=[int(input()) for i in range(10)]
W.sort()
K.sort()
w=W[7]+W[8]+W[9]
k=K[7]+K[8]+K[9]
print(w, k)

Submission status: Accepted

Solution code:
x=[int(input()) for i in range(20)]

a=x[0:10]
b=sorted(a)
del b[0:7]

c=x[10:]
d=sorted(c)
del d[0:7]

print(sum(b),sum(d))

Submission status: Accepted

Solution code:
a=[]
b=[]
for i in range(10):
  a.append(int(input()))
  a.sort()

for j in range(10,20):
  b.append(int(input()))
  b.sort()
  
W=sum(a[7:10])
K=sum(b[7:10])
print(W,K)

Submission status: Accepted

Solution code:
lst=[]
lt=[]
for i in range (10):
    n=int(input())
    lst.append(n)
lst.sort()
for i in range(7):
    lst.pop(0)

    
for i in range (10):
    m=int(input())
    lt.append(m)
lt.sort()
for i in range(7):
    lt.pop(0)

    
a=sum(lst)
b=sum(lt)
print(f'{a:.3g} {b:.3g}')

Submission status: Accepted

Solution code:
a=[]
b=[]
for i in range(10):
    n=int(input())
    a.append(n)
for i in range (10,20):
    n=int(input())
    b.append(n)
a.sort()
b.sort()
print(a[7]+a[8]+a[9],b[7]+b[8]+b[9])

Submission status: Accepted

Solution code:
lst = []

for i in range(20):
    r = int(input())
    lst.append(r)
    
for i in range(10):
    for j in range(9,i,-1):
        if lst[j] < lst[j-1]:
            lst[j],lst[j-1] = lst[j-1],lst[j]

for i in range(10,20):
    for j in range(19,i,-1):
        if lst[j] < lst[j-1]:
            lst[j],lst[j-1] = lst[j-1],lst[j]

W = lst[9]+lst[8]+lst[7]
K = lst[19]+lst[18]+lst[17]

print(W,K)

Submission status: Accepted

Solution code:
W = []
K = []
SW=0
SK = 0
for i in range(10):
    w = int(input())
    W.append(w)
    W.sort(reverse=True)
for i in range(10):
    k = int(input())
    K.append(k)
    K.sort(reverse=True)
for i in range(3):
    SW = SW + W[i]
for i in range(3):
    SK = SK + K[i] 
print(SW,SK)

Submission status: Accepted

Solution code:
a = []
b = []

for i in range(10) :
    a.append(int(input()))
for i in range(10) :
    b.append(int(input()))

a.sort()
b.sort()
sum_a = sum(a[7:])
sum_b = sum(b[7:])

print(sum_a, sum_b)

Submission status: Accepted

Solution code:
#(45)コンテスト
a=[]
for i in range(10):
    n=int(input())
    a.append(n)
a.sort(reverse=True)
b=[]
for j in range(10):
    m=int(input())
    b.append(m)
b.sort(reverse=True)
w=0
K=0
for k in range(3):
    w+=a[k]
    K+=b[k]
print(w,K)

Submission status: Accepted

Solution code:
list_W = []
list_K = []

for i in range(10) :
    list_W.append(int(input()))
for i in range(10) :
    list_K.append(int(input()))

list_W.sort(reverse = True)
list_K.sort(reverse = True)

sum_W = sum(list_W[0:3])
sum_K = sum(list_K[0:3])

print(sum_W, sum_K)

Submission status: Accepted

Solution code:
W = []
K = []
for i in range (10):
    W.append(int(input()))
for i in range (10):
    K.append(int(input()))
    
    W.sort(reverse = True)
    K.sort(reverse = True)
    point_W = sum(W[:3])
    point_K = sum(K[:3])

print(point_W, point_K)

Submission status: Accepted

Solution code:
def func():
    list = []
    for i in range(10):
        list.append(int(input()))
    list.sort()
    return sum(list[-3:])
print(func(),func())

Submission status: Accepted

Solution code:
W = []
K = []
for i in range (10):
    W.append(int(input()))
for i in range (10):
    K.append(int(input()))
W.sort(reverse = True)
K.sort(reverse = True)
point_W = sum(W[:3])
point_K = sum(K[:3])
print(point_W,point_K)

Submission status: Accepted

Solution code:
list_w = []
list_k = []
for x in range(10):
    list_w.append(int(input()))
list_w.sort(reverse = True)
for x in range(10):
    list_k.append(int(input()))
list_k.sort(reverse = True)
print(str(sum(list_w[0:3])) +' '+ str(sum(list_k[0:3])))

Submission status: Accepted

Solution code:
s = []
for i in range(10):
    s.append(int(input()))
l = []
for i in range(10):
    l.append(int(input()))
    
a=sorted(s)[-1]
b=sorted(s)[-2]
c=sorted(s)[-3]
e=sorted(l)[-1]
d=sorted(l)[-2]
f=sorted(l)[-3]

print(a+b+c,end=' ')
print(e+d+f)

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(10)]
a.sort()



b=[int(input()) for i in range(10)]
b.sort()
print(sum((a[-3:])),sum((b[-3:])))

Submission status: Accepted

Solution code:
x=[]
y=[]

for i in range(10):
    X = int(input())
    x.append(X)
    
for i in range (10):
    Y = int(input())
    y.append(Y)
    
list.sort(x, reverse=True)
    
list.sort(y,reverse=True)
    
print(x[0]+x[1]+x[2], y[0]+y[1]+y[2])

Submission status: Accepted

Solution code:
list=[]
for i in range(10):
    a=int(input())
    list.append(a)
A=sum(sorted(list,reverse=True)[:3])

lst=[]
for i in range(10):
    a=int(input())
    lst.append(a)
B=sum(sorted(lst,reverse=True)[:3])

print(A,B)

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(10)]
b=[int(input()) for i in range(10)]
a.sort()
b.sort()
print(a[7]+a[8]+a[9],b[7]+b[8]+b[9])

Submission status: Accepted

Solution code:
list_w = []
list_k = []

for i in range(10) :
    list_w.append(int(input()))
for i in range(10) :
    list_k.append(int(input()))

list_w.sort(reverse = True)
list_k.sort(reverse = True)

sumw = sum(list_w[0:3])
sumk = sum(list_k[0:3])

print(sumw, sumk)

Submission status: Accepted

Solution code:
W = []
for w in range(10):
    w = int(input())
    W.append(w)
K = []
for k in range(10):
    k = int(input())
    K.append(k)
W.sort()
K.sort()
a1 = W[7] + W[8] + W[9]
a2 = K[7] + K[8] + K[9]
print(a1,a2)

Submission status: Accepted

Solution code:
w=[]
for i in range(10):
    n=int(input())
    w.append(n)
wa = sorted(w, reverse=True)
W=sum(wa[:3])

k=[]
for j in range(10):
    m=int(input())
    k.append(m)
ka = sorted(k, reverse=True)
K=sum(ka[:3])

print(W, K)

Submission status: Accepted

Solution code:
num1=[]
num2=[]
for i in range(10):
    x=int(input())
    num1.append(x)
    
for i in range(10):
    y=int(input())
    num2.append(y)   
    
num1.sort()
num2.sort()

a=num1[7]+num1[8]+num1[9]
b=num2[7]+num2[8]+num2[9]

print(a,b)

Submission status: Accepted

Solution code:
W = list()
K = list()

for i in range(10):
    W.append(int(input()))

W.sort()
W.reverse()

for i in range(10):
    K.append(int(input()))

K.sort()
K.reverse()

#print('@',W[0:],K[0:])

print(sum(W[0:3]),sum(K[0:3]))

Submission status: Accepted

Solution code:
list=[int(input()) for i in range(20)]
W=[]
for j in range(10):
    W.append(list[j])
K=[]
for n in range(10,20):
    K.append(list[n])
w=sorted(W)
k=sorted(K)
wsum=0
ksum=0
for m in range(7,10):
    wsum+=int(w[m])
    ksum+=int(k[m])
print(wsum,ksum)

Submission status: Accepted

Solution code:
import sys
import math

w = sorted( [int(input()) for i in range(10)] )
k = sorted( [int(input()) for i in range(10)] )

print(sum(w[7:10]),sum(k[7:10]))

Submission status: Accepted

Solution code:
w=[]
k=[]

for i in range(0,10):
    w.append(int(input()))
    w.sort(reverse=True)
    sum_w=sum(w[0:3])
for i in range(10,20):
    k.append(int(input()))
    k.sort(reverse=True)
    sum_k=sum(k[0:3])
print(sum_w,sum_k)

Submission status: Accepted

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

a = []
b = []
for i in range(0,10):
    n = int(input())
    a.append(n)
    a.sort()
    W = a[7:10]
for i in range(10,20):
    n = int(input())
    b.append(n)
    b.sort()
    K = b[7:10]
print(sum(W),sum(K))

Submission status: Accepted

Solution code:
list_1=[]
list_2=[]
x=0
y=0

for i in range(10):
   a=int(input())
   list_1.append(a)
for j in range(10):
   b=int(input())
   list_2.append(b)

list_1.sort(reverse=True)
list_2.sort(reverse=True)

for m in range(3):
   x+=list_1[m]
   y+=list_2[m]

print(x,y)

Submission status: Accepted

Solution code:
w=[]
k=[]

for i in range(10):
    w.append(int(input()))
for i in range(10):
    k.append(int(input()))

w.sort()
k.sort()

print(sum(w[7:]),sum(k[7:]))

Submission status: Accepted

Solution code:
N=10
M=10
sumW=0
sumK=0
I=[int(input()) for _ in range(N)]
I.sort()
sumW=sumW+I[9]+I[8]+I[7]
J=[int(input()) for _ in range(M)]
J.sort()
sumK=sumK+J[9]+J[8]+J[7]
print(sumW,sumK)

Submission status: Accepted

Solution code:
a = []
for i in range(10):
  a.append(int(input()))
b = []
for j in range(10):
  b.append(int(input()))
la = sorted(a, reverse=True)
x = la[:3]
lb = sorted(b, reverse=True)
y = lb[:3]
print(sum(x), sum(y))

Submission status: Accepted

Solution code:
w=[]
k=[]
for i in range(10):
    w.append(int(input()))
    w.sort()
W=sum(w[7:])
for j in range(10):
    k.append(int(input()))
    k.sort()
K=sum(k[7:])
print(f'{W} {K}')

Submission status: Accepted

Solution code:
w=[]
k=[]
for i in range(10):
  w.append(int(input()))
w.sort()

for i in range(10):
  k.append(int(input()))
k.sort()

print(sum(w[7:10]),sum(k[7:10]))

Submission status: Accepted

Solution code:
W=[]
K=[]
for i in range(10):
   W.append(int(input()))
   W.sort()
   W.reverse()
for i in range(10):
   K.append(int(input()))
   K.sort()
   K.reverse()

print(sum(W[0:3]), sum(K[0:3]))

Submission status: Accepted

Solution code:
list1=[]
list2=[]
for i in range(10):
    list1.append(int(input()))
list1.sort(reverse=True)
    
for i in range(10):
    list2.append(int(input()))
list2.sort(reverse=True)

s=sum(list1[0:3])
m=sum(list2[0:3])
print(f'{s} {m}')

Submission status: Accepted

Solution code:
wdai = []
wsaiko = []
kdai = []
ksaiko = []
for a in range(10):
  wdai.append(int(input()))
for c in range(10):
  kdai.append(int(input()))
for b in range(3):
  wsaiko.append(max(wdai))
  wdai.remove(max(wdai))
for d in range(3):
  ksaiko.append(max(kdai))
  kdai.remove(max(kdai))
print(sum(wsaiko),sum(ksaiko))

Submission status: Accepted

Solution code:
import heapq
list=[]
a=[int(input()) for i in range(20)]
b=a[:10]
c=a[10:20]
print(sum(heapq.nlargest(3,b)),sum(heapq.nlargest(3,c)))

Submission status: Accepted

Solution code:
s=[]
for j in range(2):
    w=[]
    for i in range(10):
        n=int(input())
        w.append(n)
    w=sorted(w,reverse=True)[:3]
    s.append(sum(w))
print(s[0],s[1])

Submission status: Accepted

Solution code:
list1=[]
for i in range(10):
    n=int(input())
    list1.append(n)
list1.sort()

del list1[0:7]
    
list2=[]
for i in range(10):
    m=int(input())
    list2.append(m)
list2.sort()

del list2[0:7]

a=sum(list1)
b=sum(list2)

print(a,b)

Submission status: Accepted

Solution code:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
f=int(input())
g=int(input())
h=int(input())
i=int(input())
j=int(input())
k=int(input())
l=int(input())
m=int(input())
n=int(input())
o=int(input())
p=int(input())
q=int(input())
r=int(input())
s=int(input())
t=int(input())

x = (a,b,c,d,e,f,g,h,i,j)
y = (k,l,m,n,o,p,q,r,s,t)
z = sorted(x)
w = sorted(y)

print(sum(z[7:]),sum(w[7:]))

Submission status: Accepted

Solution code:
S=[]
for i in range(10):
    n=int(input())
    S.append(n)
    i+=1
    
T=[]
for j in range(10):
    m=int(input())
    T.append(m)
    j+=1
    
A=[]
for k in range(3):
    a=max(S)
    S.remove(a)
    A.append(a)
    
B=[]
for l in range(3):
    b=max(T)
    T.remove(b)
    B.append(b)
    
P=sum(A)
Q=sum(B)

print(P,Q)

Submission status: Accepted

Solution code:
a=[]
for i in range (20):
    a.append(int(input()))
c=a[0:10]
cc=sorted(c)
C=sum(cc[7:10])
d=a[10:20]
dd=sorted(d)
D=sum(dd[7:10])
print("{} {}".format(C,D))

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(20)]
b=a[0:10]
c=a[10:20]
b.sort(reverse=True)
c.sort(reverse=True)
print(sum(b[:3]),sum(c[:3]))

Submission status: Accepted

Solution code:
lst=[]
for i in range(20):
    n=int(input())
    lst.append(n)

lst1=lst[0:10]
lst2=lst[10:20]
lst1.sort(reverse=True)
lst2.sort(reverse=True)
lst3=lst1[0:3]
lst4=lst2[0:3]

print(sum(lst3),sum(lst4))

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n1=int(input())
n2=int(input())
n3=int(input())
n4=int(input())
n5=int(input())
n6=int(input())
n7=int(input())
n8=int(input())
n9=int(input())
n10=int(input())
n11=int(input())
n12=int(input())
n13=int(input())
n14=int(input())
n15=int(input())
n16=int(input())
n17=int(input())
n18=int(input())
n19=int(input())
n20=int(input())

n1,n2,n3,n4,n5,n6,n7,n8,n9,n10=sorted([n1,n2,n3,n4,n5,n6,n7,n8,n9,n10])
n11,n12,n13,n14,n15,n16,n17,n18,n19,n20=sorted([n11,n12,n13,n14,n15,n16,n17,n18,n19,n20])

print(n8+n9+n10,n18+n19+n20)

Submission status: Accepted

Solution code:
def func():
  lst = []
  for i in range(10):
    lst.append(int(input()))
  lst.sort()
  return sum(lst[-3:])
print(func(),func())

Submission status: Accepted

Solution code:
l=[]
m=[]
for i in range(10):
    n=int(input())
    l.append(n)
    l.sort()
    l.reverse()
for k in range(10):
    a=int(input())
    m.append(a)
    m.sort()
    m.reverse()
print(sum(l[0:3]),sum(m[0:3]))

Submission status: Accepted

Solution code:
a=[int(input()) for i in range(10)]
a.sort()



b=[int(input()) for i in range(10)]
b.sort()
print(sum((a[-3:])),sum((b[-3:])))

Submission status: Accepted

Solution code:
list=[]

for i in range(20):
    n=int(input())
    list.append(n)


list1=list[:10]
list2=list[10:]

list1.sort()
list2.sort()

del list1[0:7]
del list2[0:7]
print(sum(list1),sum(list2))

Submission status: Accepted

Solution code:
list1=[]
list2=[]
for i in range(10):
    n=int(input())
    list1.append(n)
for x in range(10):
    a=int(input())
    list2.append(a)
list1.sort()
list1.reverse()

list2.sort()
list2.reverse()
print(f'{(list1[0]+list1[1]+list1[2])} {(list2[0]+list2[1]+list2[2])}')

Submission status: Accepted

Solution code:
lstr=[int(input()) for i in range(10)]
lsts=[int(input()) for j in range(10)]

mr=max(lstr)
mr2=sorted(lstr)[-2]
mr3=sorted(lstr)[-3]
ms=max(lsts)
ms2=sorted(lsts)[-2]
ms3=sorted(lsts)[-3]
print(mr+mr2+mr3,ms+ms2+ms3)

Submission status: Accepted

Solution code:
w=[]
for i in range(10):
    a=int(input())
    w.append(a)
    
w=sorted(w,reverse=True)
w=w[:3]
 
k=[]    
for j in range(10):
    a=int(input())
    k.append(a)
    
k=sorted(k,reverse=True)
k=k[:3]

print(sum(w),sum(k))

Submission status: Accepted

Solution code:
alist = []
blist = []
for i in range(10):
    a = int(input())
    alist.append(a)
for i in range(10):
    b = int(input())
    blist.append(b)
x = sorted(alist)
y = sorted(blist)
list.sort(x, reverse=True)
list.sort(y, reverse=True)
s=x[0]+x[1]+x[2]
t=y[0]+y[1]+y[2]
print(s,t)

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(20)]
w=a[:10]
k=a[10:20]
w.sort()
k.sort()
print(sum(w[7:10]),sum(k[7:10]))

Submission status: Accepted

Solution code:
x = []
y = []
for i in range(10):
    n = int(input())
    x.append(n)
    x = sorted(x)
p=x[7:10]
for i in range(10):
    n = int(input())
    y.append(n)
    y = sorted(y)
q=y[7:10]
print(sum(p),sum(q))

Submission status: Accepted

Solution code:
a=[]
for i in range(10):
    n=int(input())
    a.append(n)
a.sort(reverse=True)
b=[]
for j in range(10):
    m=int(input())
    b.append(m)
b.sort(reverse=True)
W=0
K=0
for k in range(3):
    W+=a[k]
    K+=b[k]
print(W,K)

Submission status: Accepted

Solution code:
W=[]
K=[]
for i in range(10):
    s=int(input())
    W.append(s)
for j in range(10):
    t=int(input())
    K.append(t)
W=sorted(W)
K=sorted(K)
print(f'{sum(W[7:10])} {sum(K[7:10])}')

Submission status: Accepted

Solution code:
a = []
for i in range(20):
    n = int(input())
    a.append(n)
x = a[0:10]
y = a[10:20]
X = sorted(x, reverse=True)
Y = sorted(y, reverse=True)
b = X[0]+X[1]+X[2]
c = Y[0]+Y[1]+Y[2]
print(b, c)

Submission status: Accepted

Solution code:
W=[]
K=[]
for i in range(10):
    S1=int(input())
    W.append(S1)
for j in range(10):
    S2=int(input())
    K.append(S2)
J1=0
J2=0
for k in range(3):
    J1+=max(W)
    W.remove(max(W))
    J2+=max(K)
    K.remove(max(K))
print(J1,J2,sep=' ')

Submission status: Accepted

Solution code:
T=[]
for t in range(10):
    t=int(input())
    T.append(t)
K=[]
for k in range(10):
    k=int(input())
    K.append(k)
T.sort()
K.sort()
print(T[7]+T[8]+T[9],K[7]+K[8]+K[9])

Submission status: Accepted

Solution code:
l=[]
m=[]
s=0
for i in range(20):
    a=int(input())
    if s<10:
        l.append(a)
    else:
        m.append(a)
   
    s=s+1
    
l=sorted(l,reverse=True)
m=sorted(m,reverse=True)





print(l[0]+l[1]+l[2],m[0]+m[1]+m[2])

Submission status: Accepted

Solution code:
#(44)科目選択
a=[]
for i in range(10):
     n=int(input())
     a.append(n)
a.sort(reverse=True)
b=[]
for j in range(10):
     m=int(input())
     b.append(m)
b.sort(reverse=True)
W=0
K=0
for k in range(3):
     W+=a[k]
     K+=b[k]
print(W,K)

Submission status: Accepted

Solution code:
lis_1=[]
lis_2=[]
for i in range(10):
    a=int(input())
    lis_1.append(a)
lis_1.sort()
for i in range(10,20):
    a=int(input())
    lis_2.append(a)
lis_2.sort()
x=lis_1[-1]
y=lis_1[-2]
z=lis_1[-3]
v=x+y+z
s=lis_2[-1]
t=lis_2[-2]
u=lis_2[-3]
w=s+t+u
print(v,w)

Submission status: Accepted

Solution code:
x=[]
y=[]
for i in range(10):
    s=int(input())
    x.append(int(s))
a=sorted(x)
A=sum(a[7:10])

for i in range(10):
    s=int(input())
    y.append(int(s))
b=sorted(y)
B=sum(b[7:10])
print(A,B)

Submission status: Accepted

Solution code:
lst=[]
lt=[]
for i in range (10):
    n=int(input())
    lst.append(n)
lst.sort()
for i in range(7):
    lst.pop(0)

    
for i in range (10):
    m=int(input())
    lt.append(m)
lt.sort()
for i in range(7):
    lt.pop(0)

    
a=sum(lst)
b=sum(lt)
print(f'{a:.3g} {b:.3g}')

Submission status: Accepted

Solution code:
w1=int(input())
w2=int(input())
w3=int(input())
w4=int(input())
w5=int(input())
w6=int(input())
w7=int(input())
w8=int(input())
w9=int(input())
w10=int(input())

k1=int(input())
k2=int(input())
k3=int(input())
k4=int(input())
k5=int(input())
k6=int(input())
k7=int(input())
k8=int(input())
k9=int(input())
k10=int(input())

waseda=[w1,w2,w3,w4,w5,w6,w7,w8,w9,w10]
keio=[k1,k2,k3,k4,k5,k6,k7,k8,k9,k10]

waseda.sort()
keio.sort()

w=waseda[7]+waseda[8]+waseda[9]
k=keio[7]+keio[8]+keio[9]

print(w,k)

Submission status: Accepted

Solution code:
lstW=[]
lstK=[]
for i in range(10):
    W = int(input())
    lstW.append(W)
for i in range(10):
    K = int(input())
    lstK.append(K)
print(sum(sorted(lstW)[7:]),sum(sorted(lstK)[7:]))

Submission status: Accepted

Solution code:
a = [int(input()) for i in range(20)]
w = a[0:10]
k = a[10:20]
w.sort()
k.sort()
w1 = sum(w[7:10])
k1 = sum(k[7:10])
print(w1,k1)

Submission status: Accepted

Solution code:
w = [int(input()) for i in range(10)]
k = [int(input()) for i in range(10)]
w.sort(reverse = True)
k.sort(reverse = True)
print(sum(w[:3]),sum(k[:3]))

Submission status: Accepted

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

W = []
K = []
for i in range(10):
   W.append(int(input()))
   W.sort()
   W.reverse()
for i in range(10):
   K.append(int(input()))
   K.sort()
   K.reverse()

print(sum(W[0:3]), sum(K[0:3]))

Submission status: Accepted

Solution code:
a=[]
c=[]
for i in range(10):
    b=int(input())
    a.append(b)
a.sort()
A=a[7]+a[8]+a[9]
for i in range(10):
    d=int(input())
    c.append(d)
c.sort()
C=c[7]+c[8]+c[9]
print(A,C)