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 "bits/stdc++.h"
#define rep(i,a,n) for(int i = (a);i < (n);i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

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

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 <iostream>
#include <algorithm>

using namespace std;

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)

int main(){
    int a[2][10];
    rep(i,2)rep(k,20) cin>>a[i][k];
    sort(a[0],a[0]+10); sort(a[1],a[1]+10);
    cout<<a[0][9]+a[0][8]+a[0][7]<<" "
        <<a[1][9]+a[1][8]+a[1][7]<<endl;
}

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);
	reverse(a, a + 10);
	sort(b, b + 10);
	reverse(b, b + 10);
	cout << a[0] + a[1] + a[2] << ' ' << b[0] + b[1] + b[2] << endl;
	return 0;
}

C++: #include <iostream>
#include <stack>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

int main()
{
	int k[10],w[10],kp = 0,wp = 0,maxk,maxw,n = 0,tk,tw;
	for(int i=0; i<10; i++)
		cin>>k[i];
	for(int i=0; i<10; i++)
		cin>>w[i];

	while(n < 3)
	{
		for(int i=0; i<10; i++){
			if(maxk < k[i]){
				maxk = k[i];
				tk =i;
			}
		}
		kp += maxk;
		maxk = 0;
		k[tk] = 0;

		for(int i=0; i<10; i++){
			if(maxw < w[i]){
				maxw = w[i];
				tw =i;
			}
		}
		wp += maxw;
		maxw = 0;
		w[tw] = 0;
		
		n++;
	}
	cout<<kp<<" "<<wp<<endl;		

	return 0;

}

C++: #include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    vector<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];

    cout << accumulate(w.begin(), w.begin()+3, 0) << ' '
         << accumulate(k.begin(), k.begin()+3, 0) << endl;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c[101]={0},d,e,f;
	for (a=0;a<10;a++)
	{
		cin>>b;
		c[b]=1;
	}
	d=0;
	e=0;
	for (a=100;a>=0;a--)
	{
		if (c[a]==1&&d<3)
		{
			e=e+a;
			d++;
		}
	}
	c[101]={0};
	for (a=0;a<10;a++)
	{
		cin>>b;
		c[b]=1;
	}
	d=0;
	f=0;
	for (a=100;a>=0;a--)
	{
		if (c[a]==1&&d<3)
		{
			f=f+a;
			d++;
		}
	}
	cout<<e<<" "<<f<<endl;
	return 0;
}

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,r=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){
		r=num1;
		num1=num2;
		num2=r;
	}
	if(num1<num3){
		r=num1;
		num1=num3;
		num3=r;
	}
	if(num1<num4){
		r=num1;
		num1=num4;
		num4=r;
	}
	if(num1<num5){
		r=num1;
		num1=num5;
		num5=r;
	}
	if(num1<num6){
		r=num1;
		num1=num6;
		num6=r;
	}
	if(num1<num7){
		r=num1;
		num1=num7;
		num7=r;
	}
	if(num1<num8){
		r=num1;
		num1=num8;
		num8=r;
	}
	if(num1<num9){
		r=num1;
		num1=num9;
		num9=r;
	}
	if(num1<num10){
		r=num1;
		num1=num10;
		num10=r;
	}
	if(num2<num3){
		r=num2;
		num2=num3;
		num3=r;
	}
	if(num2<num4){
		r=num2;
		num2=num4;
		num4=r;
	}
	if(num2<num5){
		r=num2;
		num2=num5;
		num5=r;
	}
	if(num2<num6){
		r=num2;
		num2=num6;
		num6=r;
	}
	if(num2<num7){
		r=num2;
		num2=num7;
		num7=r;
	}
	if(num2<num8){
		r=num2;
		num2=num8;
		num8=r;
	}
	if(num2<num9){
		r=num2;
		num2=num9;
		num9=r;
	}
	if(num2<num10){
		r=num2;
		num2=num10;
		num10=r;
	}
	if(num3<num4){
		r=num3;
		num3=num4;
		num4=r;
	}
	if(num3<num5){
		r=num3;
		num3=num5;
		num5=r;
	}
	if(num3<num6){
		r=num3;
		num3=num6;
		num6=r;
	}
	if(num3<num7){
		r=num3;
		num3=num7;
		num7=r;
	}
	if(num3<num8){
		r=num3;
		num3=num8;
		num8=r;
	}
	if(num3<num9){
		r=num3;
		num3=num9;
		num9=r;
	}
	if(num3<num10){
		r=num3;
		num3=num10;
		num10=r;
	}
	if(num11<num12){
		r=num11;
		num11=num12;
		num12=r;
	}
	if(num11<num13){
		r=num11;
		num11=num13;
		num13=r;
	}
	if(num11<num14){
		r=num11;
		num11=num14;
		num14=r;
	}
	if(num11<num15){
		r=num11;
		num11=num15;
		num15=r;
	}
	if(num11<num16){
		r=num11;
		num11=num16;
		num16=r;
	}
	if(num11<num17){
		r=num11;
		num11=num17;
		num17=r;
	}
	if(num11<num18){
		r=num11;
		num11=num18;
		num18=r;
	}
	if(num11<num19){
		r=num11;
		num11=num19;
		num19=r;
	}
	if(num11<num20){
		r=num11;
		num11=num20;
		num20=r;
	}
	if(num12<num13){
		r=num12;
		num12=num13;
		num13=r;
	}
	if(num12<num14){
		r=num12;
		num12=num14;
		num14=r;
	}
	if(num12<num15){
		r=num12;
		num12=num15;
		num15=r;
	}
	if(num12<num16){
		r=num12;
		num12=num16;
		num16=r;
	}
	if(num12<num17){
		r=num12;
		num12=num17;
		num17=r;
	}
	if(num12<num18){
		r=num12;
		num12=num18;
		num18=r;
	}
	if(num12<num19){
		r=num12;
		num12=num19;
		num19=r;
	}
	if(num12<num20){
		r=num12;
		num12=num20;
		num20=r;
	}
	if(num13<num14){
		r=num13;
		num13=num14;
		num14=r;
	}
	if(num13<num15){
		r=num13;
		num13=num15;
		num15=r;
	}
	if(num13<num16){
		r=num13;
		num13=num16;
		num16=r;
	}
	if(num13<num17){
		r=num13;
		num13=num17;
		num17=r;
	}
	if(num13<num18){
		r=num13;
		num13=num18;
		num18=r;
	}
	if(num13<num19){
		r=num13;
		num13=num19;
		num19=r;
	}
	if(num13<num20){
		r=num13;
		num13=num20;
		num20=r;
	}
	num21=num1+num2+num3;
	num22=num11+num12+num13;
	cout<< num21 <<" "<< num22 <<"\n";
	return 0;
}

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

int main(void){
    vector<int> wscore(10);
    vector<int> kscore(10);

    int wmax = 0;
    int kmax = 0;

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

    for(int i=0; i < 3; i++){
        vector<int>::iterator max = max_element(wscore.begin(), wscore.end());
        wmax += *max;
        wscore.erase(max);
    }
    for(int i=0; i < 3; i++){
        vector<int>::iterator max = max_element(kscore.begin(), kscore.end());
        kmax += *max;
        kscore.erase(max);
    }

    cout << wmax << " " << kmax << endl;
    return 0;

}

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

using namespace std;

int main() {
  set<int,greater<int> > w,k;
  int n,i;

  for(i=0;i<10;i++){
    cin >> n;
    w.insert(n);
  }
  for(;i<20;i++){
    cin >> n;
    k.insert(n);
  }
  
  int total_w=0,total_k=0;
  set<int>::iterator it;
  for(it=w.begin(),i=0;i<3;i++,it++){
    total_w += *it;
  }
  
  for(it=k.begin(),i=0;i<3;i++){
    total_k += *it++;
  }
  cout << total_w << " " << total_k << endl;
  
  return 0;
}