Go: package main

import (
	"fmt"
	"sort"
)

func calcScore(n, m []int) (int, int) {
	sort.Ints(n)
	sort.Ints(m)
	
	return n[9] + n[8] + n[7], m[9] + m[8] + m[7]
}

func main(){
	var team_W, team_K []int
	var inp int
	
		for i := 0; i < 10; i++ {		
			fmt.Scan(&inp)
			team_W = append(team_W, inp)
		}

		for j := 0;  j< 10; j++ {		
			fmt.Scan(&inp)
			team_K = append(team_K, inp)
		}

	fmt.Println(calcScore(team_W, team_K))
}

C++: #include<cstdio>
#include<algorithm>
using namespace std;
int main(){
  int W[11],K[11];
  for(int i=0;i<10;i++){
    scanf("%d",&W[i]);
  }
  for(int i=0;i<10;i++){
    scanf("%d",&K[i]);
  }
  sort(W,W+10);
  sort(K,K+10);
  printf("%d %d\n",W[7]+W[8]+W[9],K[7]+K[8]+K[9]);
}

C++: #include<iostream>
#include<string>
#include<cstring>
using namespace std;
int main()
{	
	int num1=0,num2=0,num3=0,num4=0,num5=0,num6=0,num7=0,num8=0,num9=0,num10=0,num11=0,num12=0,num13=0,num14=0,num15=0,num16=0,num17=0,num18=0,num19=0,num20=0,num21=0,num22=0,a=0;
	
	cin>>num1>>num2>>num3>>num4>>num5>>num6>>num7>>num8>>num9>>num10>>num11>>num12>>num13>>num14>>num15>>num16>>num17>>num18>>num19>>num20;
	if(num1<num2){
		num1=a;
		a=num2;
		num2=num1;
	}
	if(num1<num3){
		num1=a;
		a=num3;
		num3=num1;
	}
	if(num1<num4){
		num1=a;
		a=num4;
		num4=num1;
	}
	if(num1<num5){
		num1=a;
		a=num5;
		num5=num1;
	}
	if(num1<num6){
		num1=a;
		a=num6;
		num6=num1;
	}
	if(num1<num7){
		num1=a;
		a=num7;
		num7=num1;
	}
	if(num1<num8){
		num1=a;
		a=num8;
		num8=num1;
	}
	if(num1<num9){
		num1=a;
		a=num9;
		num9=num1;
	}
	if(num1<num10){
		num1=a;
		a=num10;
		num10=num1;
	}
	if(num2<num3){
		num2=a;
		a=num3;
		num3=num2;
	}
	if(num2<num4){
		num2=a;
		a=num4;
		num4=num2;
	}
	if(num2<num5){
		num2=a;
		a=num5;
		num5=num2;
	}
	if(num2<num6){
		num2=a;
		a=num6;
		num6=num2;
	}
	if(num2<num7){
		num2=a;
		a=num7;
		num7=num2;
	}
	if(num2<num8){
		num2=a;
		a=num8;
		num8=num2;
	}
	if(num2<num9){
		num2=a;
		a=num9;
		num9=num2;
	}
	if(num2<num10){
		num2=a;
		a=num10;
		num10=num2;
	}
	if(num3<num4){
		num3=a;
		a=num4;
		num4=num3;
	}
	if(num3<num5){
		num3=a;
		a=num5;
		num5=num3;
	}
	if(num3<num6){
		num3=a;
		a=num6;
		num6=num3;
	}
	if(num3<num7){
		num3=a;
		a=num7;
		num7=num3;
	}
	if(num3<num8){
		num3=a;
		a=num8;
		num8=num3;
	}
	if(num3<num9){
		num3=a;
		a=num9;
		num9=num3;
	}
	if(num3<num10){
		num3=a;
		a=num10;
		num10=num3;
	}
	if(num11<num12){
		num11=a;
		a=num12;
		num12=num11;
	}
	if(num11<num13){
		num11=a;
		a=num13;
		num13=num11;
	}
	if(num11<num14){
		num11=a;
		a=num14;
		num14=num11;
	}
	if(num11<num15){
		num11=a;
		a=num15;
		num15=num11;
	}
	if(num11<num16){
		num11=a;
		a=num16;
		num16=num11;
	}
	if(num11<num17){
		num11=a;
		a=num17;
		num17=num11;
	}
	if(num11<num18){
		num11=a;
		a=num18;
		num18=num11;
	}
	if(num11<num19){
		num11=a;
		a=num19;
		num19=num11;
	}
	if(num11<num20){
		num11=a;
		a=num20;
		num20=num11;
	}
	if(num12<num13){
		num12=a;
		a=num13;
		num13=num12;
	}
	if(num12<num14){
		num12=a;
		a=num14;
		num14=num12;
	}
	if(num12<num15){
		num12=a;
		a=num15;
		num15=num12;
	}
	if(num12<num16){
		num12=a;
		a=num16;
		num16=num12;
	}
	if(num12<num17){
		num12=a;
		a=num17;
		num17=num12;
	}
	if(num12<num18){
		num12=a;
		a=num18;
		num18=num12;
	}
	if(num12<num19){
		num12=a;
		a=num19;
		num19=num12;
	}
	if(num12<num20){
		num12=a;
		a=num20;
		num20=num12;
	}
	if(num13<num14){
		num13=a;
		a=num14;
		num14=num13;
	}
	if(num13<num15){
		num13=a;
		a=num15;
		num15=num13;
	}
	if(num13<num16){
		num13=a;
		a=num16;
		num16=num13;
	}
	if(num13<num17){
		num13=a;
		a=num17;
		num17=num13;
	}
	if(num13<num18){
		num13=a;
		a=num18;
		num18=num13;
	}
	if(num13<num19){
		num13=a;
		a=num19;
		num19=num13;
	}
	if(num13<num20){
		num13=a;
		a=num20;
		num20=num13;
	}
	num21=num1+num2+num3;
	num22=num11+num12+num13;
	cout<< num21 <<" "<< num22 <<"\n";
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;

int main(){
    int a[10],b[10];
    for(int i=0;i<10;i++){
        cin >> a[i];
    }
    for(int i=0;i<10;i++){
        cin >> b[i];
    }
    sort(a,a + 10,greater<int>());
    sort(b,b + 10,greater<int>());
    cout << a[0]+a[1]+a[2] << " ";
    cout << b[0]+b[1]+b[2] << endl;
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cctype>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<bitset>
#include<utility>
#include<string>

using namespace std;

main(){
  int i,j,l,temp;
  int n=10;
  int m[10];
  int a[2];
  for(l=0;l<2;l++){
    for(i=0;i<n;i++){
      cin >> m[i];
    }
    for(i=n-1;i>0;i--){
      for(j=0;j<i;j++){
	if(m[j]<m[j+1]){
	  temp=m[j];
	  m[j]=m[j+1];
	  m[j+1]=temp;
	}
      }
    }
    a[l]=m[0]+m[1]+m[2];
  }
  cout << a[0] << ' ' << a[1] << endl;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10

typedef pair<int, int> pi;
typedef pair<int, pi> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

int main(){
  int W, K;
  vi w(10), k(10);
  rep(i, 10) scanf("%d", &w[i]);
  rep(i, 10) scanf("%d", &k[i]);

  sort(w.begin(), w.end(), greater<int>());
  sort(k.begin(), k.end(), greater<int>());

  W = w[0] + w[1] + w[2];
  K = k[0] + k[1]  +k[2];
  printf("%d %d\n", W, K);
  return 0;
}

C++: #include <iostream>
#include <set>
using namespace std;

int main()
{
	set<int> a;
	int h = 0;
	int hh = 0;
	for (int b = 0; b < 10; b++)
	{
		int c;
		cin >> c;
		a.insert(-c);
	}
	set<int>::iterator it = a.begin();
	for (int g = 0; g < 3; g++)
	{
		h -= *it;
		*it++;
	}
	set<int> aa;
	int h = 0;
	for (int bb = 0; bb < 10; b++)
	{
		int cc;
		cin >> cc;
		a.insert(-cc);
	}
	set<int>::iterator itt = aa.begin();
	for (int g = 0; g < 3; g++)
	{
		hh -= *itt;
		*itt++;
	}
	cout << h << endl;
	cout << hh << endl;
	return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int a[10],b[10];
int main(){
	for(int i=0;i<10;i++)cin>>a[i];
	for(int i=0;i<10;i++)cin>>b[i];
	sort(a,a+10);sort(b,b+10);
	cout<<a[7]+a[8]+a[9]<<' '<<b[7]+b[8]+b[9]<<endl;
	return 0;
}

C++: #include<cstdio>
#include<functional>
#include<algorithm>
using namespace std;
int main(void)
{
	int data[10],dai1,dai2,i;
	for(i=0;i<10;i++)	scanf("%d",&data[i]);
	sort(data,data+10);
	dai1=data[7]+data[8]+data[9];
	for(i=0;i<10;i++)	scanf("%d",&data[i]);
	sort(data,data+10);	
	dai2=data[7]+data[8]+data[9];
	printf("%d %d\n",dai1,dai2);
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int x,y[100],z[100],a=0,b=0;
    for(int i=0;i<10;i++){
            scanf("%d",&z[i]);
    }
    for(int i=0;i<10;i++){
            scanf("%d",&y[i]);
    }
    sort(z,z+10);
    reverse(z,z+10);
    sort(y,y+9);
    reverse(y,y+9);
    
    for(int i=0;i<3;i++){
        a=a+z[i];
        b=b+y[i];
    }

    cout<<a<<' '<<b<<endl;
}

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

C++: #include <iostream>
#include <string>
#include <array>
#include <vector>
#include <list>
#include <deque>
#include <set>
#include <math.h>
#include <algorithm>

using namespace std;


int main(){

	int answer = 0;

	int W[10], K[10];

	for (int i = 0; i < 10; i++) {
		cin >> W[i];
	}
	for (int i = 0; i < 10; i++) {
		cin >> K[i];
	}

	sort(W, W + 10);
	sort(K, K + 10);


	cout << W[7] + W[8] + W[9] << endl
		<< K[7] + K[8] + K[9] << endl;

	return 0;
}