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>
int main(void){
	int w[10],k[10],x=0,y=0,z,za=0,wa=0,n,s;
	for(z=0;z<10;z++){
		scanf("%d",&w[z]);
	}
	for(s=0;s<3;s++){
		for(z=0;z<10;z++){
			if(za < w[z]){
				za = w[z];
				n = z;
			}
		}
		x += za;
		w[n] = 0;
		za = 0;
		n = 0;
	}
	for(z=0;z<10;z++){
		scanf("%d",&k[z]);
	}
	for(s=0;s<3;s++){
		for(z=0;z<10;z++){
			if(wa < k[z]){
				wa = k[z];
				n = z;
			}
		}
		y += wa;
		k[n] = 0;
		wa = 0;
		n = 0;
	}
	printf("%d %d\n",x,y);
	return 0;
}

C++: #include<algorithm>
using namespace std;
int main(){
	int p[10];
	for(int i=0;i<2;i++){
		for(int j=0;j<10;j++)cin>>p[j];
		sort(p,p+10);
		if(i)cout<<" ";
		cout<<p[7]+p[8]+p[9];
	}
	cout<<endl;
	return 0;
}

C++: #include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
using namespace std;
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();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define EACH(t,i,c) for(t::iterator i=(c).begin(); i!=(c).end(); ++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int main(){
	vi w(10),k(10);
	REP(i,10){
		cin>>w[i];
	}
	REP(i,10){
		cin>>k[i];
	}

	sort(RALL(w));
	sort(RALL(k));

	int ww=0,kk=0;
	REP(i,3){
		ww+=w[i];
		kk+=k[i];
	}

	cout<<ww<<" "<<kk<<endl;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main(){
	for (int i = 0; i < 2; i++) {
		int po = 0;
		vector<int> dai(10);
		for (int i = 0; i < 10; i++) {
			cin >> dai[i];
		}
		sort(dai.begin(), dai.end());
		cout << dai[9] + dai[8] + dai[7];
		if (i == 0) {
			cout << " ";
		}
		else {
			cout << endl;
		}
	}
}

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

int main(){
int N[11]={},W[11]={},x;
int Ns=0,Ws=0;
for(int i=0;i<9;i++)
{cin>>x;N[i]=x;}
for(int i=0;i<9;i++)
{cin>>x;W[i]=x;}
for(int i=0;i<9;i++)
{for(int j=9;j>i;j--)
{if(N[j]>N[j-1]){int t=N[j];N[j]=N[j-1];N[j-1]=t;}
 if(W[j]>W[j-1]){int t=W[j];W[j]=W[j-1];W[j-1]=t;}
}
}
for(int i=0;i<3;i++)
{Ns+=N[i];Ws+=W[i];}
cout<<Ns<<" "<<Ws<<endl;
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+10);
    reverse(y,y+10);

    for(int i=0;i<3;i++){
        a=a+z[i];
        b=b+y[i];
    }

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

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;
	getchar();
	getchar();
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <set>
#include <queue>
#include <map>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int a[10];
	int 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);
	sort(b,b+10);
	cout << a[7]+a[8]+a[9] << " " << b[7]+b[8]+b[9] << endl;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int d[20];
  for(int i = 0 ; i< 20 ; i++ ) cin >> d[i];
  sort(d,d+10),sort(d+11,d+20);
  cout << d[7] + d[8] + d[9] << " " <<  d[17] + d[18] + d[19] << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    // Your code here!
    int i,j,c;
    vector<int> a;
    vector<int> b;
    for(i=0;i<10;i++)
    {
        cin>>c;
        a.push_back(c);
    }
    for(j=0;j<10;j++)
    {
        cin>>c;
        b.push_back(c);
    }
    sort(a.begin(),a.end(),greater<int>());
    sort(b.begin(),b.end(),greater<int>());
    cout<<a[0]+a[1]+a[2]<<" "<<b[0]+b[1]+b[2]<<endl;
    return 0;
}

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

int main(){
int N[11]={},W[11]={},x;
int Ns=0;Ws=0;
for(int i=0;i<9;i++)
{cin>>x;N[i]=x;}
for(int i=0;i<9;i++)
{cin>>x;W[i]=x;}
for(int i=0;i<9;i++)
{for(int j=9;j>j;j--)
{if(N[j]>N[j-1]){int t=N[j];N[j]=N[j-1];N[j-1]=t;}
 if(W[j]>W[j-1]){int t=W[j];W[j]=W[j-1];W[j-1]=t;}
}
}
for(int i=0;i<3;i++)
{Ns+=N[i];Ws+=W[i];}
cout<<Ns<<" "<<Ws<<endl;
return 0;
}

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

using namespace std;

int main()
{
	int a;
	
	vector<int> w(10);
	vector<int> k(10);
	
	for(int i = 0; i < 10; i++){
		cin >> w[i];
	}
	
	for(int i = 0; i < 10; i++){
		cin >> k[i];
	}
	
	sort(w.begin(), w.end()); 
	sort(k.begin(), k.end());
	
	printf("%d %d\n",w[9]+w[8]+w[7],k[9]+k[8]+k[7]);
	
	return 0;
}

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

using namespace std;

int main()
{
  vector<int> W;
  vector<int> K;

  for(int i = 0;i < 20;++i){
    int a;
    cin>>a;
    
    if(i < 10){
      W.push_back(a);
    }
    else{
      K.push_back(a);
    }
  }

  sort(W.begin(),W.end());
  reverse(W.begin(),W.end());
  sort(K.begin(),K.end());
  reverse(K.begin(),K.end());

  int a = 0;
  int W_p = 0;
  int K_p = 0;
  for(int e : W){
    W_p += e;
    ++a;

    if(a == 3){
      a = 0;
      break;
    }
  }

  for(int e : K){
    K_p += e;
    ++a;

    if(a == 3){
      break;
    }
  }

  cout<<W_p<<" "<<K_p<<endl;
  return 0;
}

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

using namespace std;

int main() {

  vector<int> w,k;

  int temp;


  for(int i=0;i<10;i++) {

    cin >> temp;

    w.push_back(temp);

  }

  for(int i=0;i<10;i++) {

    cin >> temp;

    k.push_back(temp);

  }

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

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

  cout << w[0]+w[1]+w[2] << " " << k[0]+k[1]+k[2] << endl;

  return 0;

}

C++: #include <iostream>
#include <algorithm>
using namespace std; 
int main() { 
  int w[10], k[10], sum[2]={}; 
  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++) { 
    sum[0]+=w[i];  
    sum[1]+=k[i]; 
  } 
  cout << sum[0] << " " << sum[1] << endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
int x[10][2],sum[2],c,d;
int main(){
for(int i=0;i<20;i++){cin>>x[i%10][i/10];}
for(int i=9999;i>=0;i--){if(c>=3){break;}
for(int j=0;j<10;j++){if(x[j][0]==i){c++;sum[0]+=x[j][0]}}}
for(int i=9999;i>=0;i--){if(d>=3){break;}
for(int j=0;j<10;j++){if(x[j][1]==i){d++;sum[1]+=x[j][1]}}}
cout<<sum[0]<<' '<<sum[1]<<endl;}