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<stdio.h>
#include<algorithm>
#include<functional>
using namespace std;
int main(void)
{
	int a[10],b[10],x,y,i;
	for(i=0;i<10;i++) scanf("%d",&a[i]);
	sort(a,a+10,greater<int>());
	for(i=0;i<10;i++) printf("%d ",a[i]);
	printf("\n");
	for(i=0;i<10;i++) scanf("%d",&b[i]);
	sort(b,b+10,greater<int>());
	for(i=0;i<10;i++) printf("%d ",b[i]);
	printf("\n");
	x=a[0]+a[1]+a[2]; y=b[0]+b[1]+b[2];
	printf("%d %d\n",x,y);
	return 0;
}

C++: #include<cstdio>
using namespace std;
int main()
{
	int a[10],b[10],i,w,k,x,j;
	x=10;
	for(i=0;i<10;i++)	scanf("%d",&a[i]);
	for(i=0;i<9;i++){
		for(j=i+1;j<10;j++){
			if(a[i]<a[j]){
				x=a[i];
				a[i]=a[j];
				a[j]=x;
			}
		}
	}
	for(i=0;i<10;i++)	scanf("%d",&b[i]);
	for(i=0;i<9;i++){
		for(j=i+1;j<10;j++){
			if(b[i]<b[j]){
				x=b[i];
				b[i]=b[j];
				b[j]=x;
			}
		}
	}
	w=0;
	for(i=0;i<3;i++)	w+=a[i];
	k=0;
	for(i=0;i<3;i++)	k+=b[i];
	printf("%d %d\n",w,k);
	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main() {
  priority_queue<int> q[2];
  int a, sum[2] = {0};
  for(int i=0; i<2; i++) {
    for(int j=0; j<10; j++) {
      cin >> a;
      q[i].push(a);
    }
  }
  for(int i=0; i<2; i++) {
    for(int j=0; j<3; j++) {
      sum[i] += q[i].top(); q[i].pop();
    }
  }
  cout << sum[0] << " " << sum[1] << endl;
}

C++: #include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);

signed main() {
	vector<int> W(10); rep(i, 0, 10) { cin >> W[i]; }
	vector<int> K(10); rep(i, 0, 10) { cin >> K[i]; }
	sort(W.begin(), W.end(), greater<int>());
	sort(K.begin(), K.end(), greater<int>());
	int w = accumulate(W.begin(), W.begin() + 3, 0);
	int k = accumulate(K.begin(), K.begin() + 3, 0);
	cout << w << " " << k << endl;
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int main(void)
{
	int a[10],b[10];
	for (int c=0;c<10;c++)cin>>a[c];
	for (int c=0;c<10;c++)cin>>b[c];
	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<stdio.h>
#include<algorithm>
using namespace std;
int main(void)
{
	int i,a[10],b[10],s,ss;
	for(i=0;i<10;i++){
		scanf("%d",&a[i]);
//		printf("a=%d\n",a[i]);
	}	
	sort(a,a+10);
	
	for(i=0;i<10;i++){
	}

	for(i=0;i<10;i++){
		scanf("%d",&b[i]);
	}	
	sort(b,b+10);
	for(i=0;i<10;i++){
	}
	
	s=a[7]+a[8]+a[9];
	ss=b[7]+b[8]+b[9];
	printf("%d %d",s,ss);
	return 0;
}

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]);
}

C++: #define _USE_MATH_DEFINES
#include <iostream>
#include <memory>
#include <memory.h>
#include <fstream>
#include <cmath>
#include <math.h>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <map>
#include <iomanip>
#include <list>
#include <cctype>
#include <algorithm>
#include <complex>

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)
using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<double, double> Pd;
typedef pair<int, P> PP;
typedef pair<int, PP> PPP;
const int INF = 1 << 29;
const double EPS = 1E-10;

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)

int main(){
	int w[10];
	int k[10];
	int ks = 0, ws = 0;
	rep(i, 10) cin >> w[i];
	rep(i, 10) cin >> k[i];
	sort(w, w + 10);
	sort(k, k + 10);
	ws = w[9] + w[8] + w[7];
	ks = k[9] + k[8] + k[7];
	cout << ws << " " << ks << endl;
	return 0;
}

C++: #include<iostream>
#include<algorithm>

using namespace std;

int main()
{
	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]<<' '<<k[7]+k[8]+k[9]<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int main(){
  int w[10],k[10];
  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[9]+w[8]+w[7],k[9]+k[8]+k[7]);
}

C++: #include <iostream>
#include<algorithm>
using namespace std;
int main(void){
    int W[10];
    int K[10];
    
    int i=0;
    while(i<10){
        cin>>W[i];
        i++;
    }
    while(i<20){
        cin>>K[i-10];
        i++;
        
    }
    sort(W,W+10);
    sort(K,K+10);
    
    cout<<W[7]+W[8]+W[9]<<" "<<K[7]+K[8]+K[9]<<endl;
    
}

C++: #include<bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define rrev(i, m, n) for(int (i)=(n)-1; (i)>=(m); (i)--)
#define erev(i, m, n) for(int (i)=(n); (i)>=(m); (i)--)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define pb            push_back
#define mp            make_pair
template<class T, class S> inline bool minup(T& m, const S x){ return m>(T)x ? (m=(T)x, true) : false; }
template<class T, class S> inline bool maxup(T& m, const S x){ return m<(T)x ? (m=(T)x, true) : false; }

static const int    INF = 1000000000;
static const ll     MOD = 1000000007LL;
static const double EPS = 1E-10;

int W[22];
int K[22];

int main()
{
  rep(i, 10) cin >> W[i];
  rep(i, 10) cin >> K[i];

  sort(W, W + 10, greater<int>());
  sort(K, K + 10, greater<int>());

  cout << W[0] + W[1] + W[2] << ' ' << K[0] + K[1] + K[2] << endl;

  return 0;
}

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

using namespace std;

int main(){

  vector<int> w(10);
  vector<int> k(10);
  int w1=0;
  int w2=0;
  int w3=0;
  int k1=0;
  int k2=0;
  int k3=0;
  
  for(int i=0;i<10;++i)
	cin>>w[i];

  for(int i=0;i<10;++i)
	cin>>k[i];

  int temp;
  for(int i=0;i<10;++i){
	if(w1<w[i]){
	  w1=w[i];
	  temp=i;
	}
  }

  w[temp]=0;
  for(int i=0;i<10;++i){
	if(w2<w[i]){
	  w2=w[i];
	  temp=i;
	}
  }

  w[temp]=0;
  for(int i=0;i<10;++i){
	if(w3<w[i]){
	  w3=w[i];
	  temp=i;
	}
  }

  

  for(int i=0;i<10;++i){
	if(k1<k[i]){
	  k1=k[i];
	  temp=i;
	}
  }

  k[temp]=0;
  for(int i=0;i<10;++i){
	if(k2<k[i]){
	  k2=k[i];
	  temp=i;
	}
  }

  k[temp]=0;
  for(int i=0;i<10;++i){
	if(k3<k[i]){
	  k3=k[i];
	  temp=i;
	}
  }
  
  cout<<w1+w2+w3<<" "<<k1+k2+k3<<endl;

  return 0;
  
}