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 <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; bb++)
	{
		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<set>
using namespace std;

int main()
{
  int n,i;
  multiset< int,greater<int> > s;
  multiset<int>::iterator it;

  for(i=0;i<10;i++){
    cin>>n;
    s.insert(n);
  }
  n=0;
  it=s.begin();
  for(i=0;i<3;i++) n+=*it++;
  cout<<n<<" ";

  s.clear();
  for(i=0;i<10;i++){
    cin>>n;
    s.insert(n);
  }
  n=0;
  it=s.begin();
  for(i=0;i<3;i++) n+=*it++;
  cout<<n<<endl;
}

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

int main(){
	vector<int> w,k;
	for(int i=0;i<10;i++){
		int n;
		cin>>n;
		w.push_back(n);
	}
	for(int i=0;i<10;i++){
		int n;
		cin>>n;
		k.push_back(n);
	}
	sort(w.begin(),w.end(),greater<int>());
	sort(k.begin(),k.end(),greater<int>());
	
	cout<<w[0]+w[1]+w[2]<<" "<<k[0]+k[2]+k[1]<<endl;
	
}

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
using namespace std;
int main(){
  vector< 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.rbegin(),A.rend());
  sort(B.rbegin(),B.rend());
  cout << accumulate(A.begin(),A.begin()+3,0) << " "
       << accumulate(B.begin(),B.begin()+3,0) << endl;
}

C++: #include <cstdi>
#include <cstdlib>

using namespace std;

int main() {
	int w[10],k[10];
	int i,j,p,q,t,s;
	int wsum=0,ksum=0,swap;
	for(i=0;i<10;i++) {
		scanf("%d\n",&w[i]);
	}
	for(t=0;t<10;t++){
		for(j=0;j<10;j++){
			if (w[j]>w[j+1]) {
				swap=w[j];
				w[j]=w[j+1];
				w[j+1]=swap;
			}
		}
	}
	wsum=w[9]+w[8]+w[7];
	for(p=0;p<10;p++){
		scanf("%d\n",&k[p]);
	}
	for(s=0;s<10;s++){
		for(q=0;q<10;q++){
			if (k[q]>k[q+1]) {
				swap=k[q];
				k[q]=k[q+1];
				k[q+1]=swap;
			}
		}
	}

		ksum=k[9]+k[8]+k[7];
		printf("%d %d\n",wsum,ksum);
		return 0;
	}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstring>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

int main()
{
    vector<int> w(10), k(10);
    REP(10) cin >> w[i];
    REP(10) cin >> k[i];
    sort(all(w), greater<int>() );
    sort(all(k), greater<int>() );
    cout << w[0] + w[1] + w[2] << " " << k[0] + k[1] + k[2] << endl;

    return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;

int sum[2];
int n[10];

int main(){
	REP(i, 2){
		REP(j, 10){
			cin >> n[j];
		}
		sort(n, n + 10, greater<int>());
		sum[i] = n[0] + n[1] + n[2];
	}
	cout << sum[0] << " " << sum[1] << endl;
}

C++: #include <bits/stdc++.h>

using namespace std;

int main()
{
  int W[11], K[11];
  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[9] + W[8] + W[7] << " " << K[9] + K[8] + K[7] << endl;
  return 0;
}

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

int main(){
  int W[10],K[10];
  int ans_W=0,ans_K=0;
  for(int i=0;i<10;i++){
    cin >> W[i];
  }
  for(int i=0;i<10;i++){
    cin >> K[i];
  }
  sort(W,W+10,greater<int>());
  sort(K,K+10,greater<int>());
  for(int i=0;i<3;i++){
    ans_W += W[i];
    ans_K += K[i];
  }
  cout << ans_W << " " << ans_K << endl;
}

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

int main() {
	int sum = 0, num[10] = { 0 };
	for (int j = 0; j < 2; j++) {
		sum = 0;
		for (int i = 0; i < 10; i++) {
			cin >> num[i];
		}
		sort(num, num + 10);
		sum = num[7] + num[8] + num[9];
		cout << sum << " ";
	}
	cout << endl;
	return 0;
}

C++: //include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <queue>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int gcd(int a, int b){
   int tmp;
   while(a%b!=0){
      tmp=a%b;
      a=b;
      b=tmp;
   }
}

int lcm(int a,int b){
   return a*b/gcd(a,b);
}

bool prime_number(int n){
   if(n==0||n==1) return false;
   vector<bool> a(n+1);
   fill(ALL(a),true);
   FOR(i,2,n/2+1){
      if(!a[i]) continue;
      for(int j=2;i*j<=n;j++){
         a[i*j]=false;
      }
   }
   return a[n];
}

int main(){
   VI a,b;
   int x;
   
   REP(i,10){
      cin >> x;
      a.PB(x);
   }
   REP(i,10){
      cin >> x;
      b.PB(x);
   }
   sort(ALL(a)); sort(ALL(b));
   cout << a[7]+a[8]+a[9] << " " << b[7]+b[8]+b[9] << endl;
}

C++: #include<algorithm>
#include<cstdio>
#define s(A) std::sort(A,A+10);
main(){
int Z[20];
for(int i=0;i<20;)
scanf("%d",Z+i++);
s(Z);
s(Z+10);
printf("%d %d\n",Z[7]+Z[8]+Z[9],Z[17]+Z[18]+Z[19]);
}