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

using namespace std;
int main()
{
  vector <int>a,b;
  int x;
  for(int i=0;i<10;i++)
    {
    cin>>x;
    a.push_back(x);
    }
  for(int i=0;i<10;i++)
    {
    cin>>x;
    b.push_back(x);
    }
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  cout<<a[9]+a[8]+a[7]<<" "<<b[9]+b[8]+b[7]<<endl;
}

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

int Sum(vector<int>& x) {
    int ret = 0;
    for (int i = 0; i < 3; i++) ret += x[9 - i];
    return ret;
}

int main() {
    vector<int> a(10), b(10);
    for (auto& i : a) cin >> i;
    for (auto& i : b) cin >> i;
    sort(a.begin(), a.end());
    sort(b.begin(), b.end());

    cout << Sum(a) << " " << Sum(b) << endl;

    return 0;
}

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

C++: #include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#include<set>
#include<complex>
#include<map>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    vi v(10); vi u(10);
    rep(i,10)cin>>v[i]; rep(i,10)cin>>u[i];
    sort(all(v),greater<int>()); sort(all(u),greater<int>());
    cout<<v[0]+v[1]+v[2]<<" "<<u[0]+u[1]+u[2]<<endl;
}

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

int main(){
  vector<int> v;

  for(int j = 0; j < 2; j++){
    int t[10];

    for(int i = 0; i < 10; i++){
      cin >> t[i];
    }
    sort(t, t + 10, greater<int>());
    v.push_back(t[0] + t[1] + t[2]);
  }

  cout << v[0] << " " << v[1] << endl;
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	vector<int>a(10);
	vector<int>b(10);
	rep(i,10)cin>>a[i];
	rep(i,10)cin>>b[i];
	sort(all(a));
	sort(all(b));
	cout<<a[9]+a[8]+a[7]<<" "<<b[9]+b[8]+b[7]<<endl;
}

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

const int INDEX_SIZE = 10;

class ContestScore {
private:
    std::array<int, INDEX_SIZE> scoreData;
public:
    void setScore(int index,int score);
    void showScoreData();
    int getTop3TotalScore();
};

void ContestScore::setScore(int index,int score){
    scoreData[index] = score;
}

void ContestScore::showScoreData(){
    for(int i : scoreData){
        std::cout << i << std::endl;
    }
}

int ContestScore::getTop3TotalScore(){
    std::sort(scoreData.begin(),scoreData.end());
    int dataSize = scoreData.size();
    return scoreData[dataSize - 1] + scoreData[dataSize - 2] + scoreData[dataSize - 3];
}

ContestScore inputContestScore();

int main(){
    
    //1stGroup
    ContestScore cs1 = ContestScore();
    cs1 = inputContestScore();

    //2ndGroup
    ContestScore cs2 = ContestScore();
    cs2 = inputContestScore();

    std::cout << cs1.getTop3TotalScore() << " " << cs2.getTop3TotalScore() << std::endl;

    return 0;
}

ContestScore inputContestScore(){
    ContestScore cs = ContestScore();
    for(int i = 0;i < INDEX_SIZE;i++){
        int input = 0;
        std::cin >> input;
        cs.setScore(i, input);
    }
    return cs;
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
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);
	reverse(W, W + 10);
	sort(K, K + 10);
	reverse(K, K + 10);
	cout << W[0] + W[1] + W[2] << " " << K[0] + K[1] + K[2] << endl;

	//ポイントカード
	/*
	int N, M;
	cin >> N >> M;
	int a;
	int A[5000];
	int b = 0;
	int x = 0;
	for (int i = 0; i <  M; i++) {
		cin >> a;
		if (a < N) {
			A[x]=a;
			x++;
		}
		else
		{
			b++;
		} 
		cin >> a;
	}
	int sum = 0;
	if (b < M - 1) {
		sort(A, A+x);
		reverse(A, A+x);
		for (int i = 0; i < M - 1 - b; i++) {
			sum += N - A[i];
		}
	}
	cout << sum << endl;
	*/

	//合計時間
	/*
	int sum=0, n;
	for (int i = 0; i < 4; i++) {
	cin >> n;
	sum += n;
	}
	cout << sum / 60 << endl;
	cout << sum % 60 << endl;
	//平均点
	/*
	int P[5];
	int sum=0;
	for (int i = 0; i < 5; i++) {
	cin >> P[i];
	if (P[i] < 40) P[i] = 40;
	sum += P[i];
	}
	cout << sum / 5 << endl;
	*/
	//投票
	/*
	int N, M;
	cin >> N >> M;
	int A[1000], vote[1000];
	for (int i = 0; i < N; i++) {
	cin >> A[i];
	vote[i] = 0;
	}
	int b;
	for (int i = 0; i < M; i++) {
	cin >> b;
	for (int j = 0; j < N; j++) {
	if (A[j] <= b) {
	vote[j]++;
	break;
	}
	}
	}
	int temps = 0, ans;
	for (int i = 0; i < N; i++) {
	if (vote[i] > temps) {
	temps = vote[i];
	ans = i;
	}
	}
	cout << ans + 1 << endl;
	*/

	//2.すごろく	
	/*
	int n;
	cin >> n;
	int A, _A = 1;
	int k = 0;
	int A_count[100];
	A_count[0] = 1;
	for (int i = 0; i < n; i++)
	{
	cin >> A;
	if (A == 1)
	{
	if (A == _A)
	{
	A_count[k]++;
	}
	else
	{
	k++;
	A_count[k] = 2;
	}
	}
	_A = A;
	}
	sort(A_count, A_count + k + 1);
	cout << A_count[k] << endl;
	*/

	//タイムカード
	/*
	int t[2][3];
	int x[3][3];
	for (int n=0; n < 3; n++)
	{
	for (int i=0; i < 2; i++)
	for (int k=0; k < 3; k++)
	cin >> t[i][k];

	for (int m = 2; m >= 0; m--)
	{
	x[n][m] = t[1][m] - t[0][m];
	if (t[0][m] > t[1][m])
	{
	x[n][m] += 60;
	t[1][m - 1]--;
	}
	}
	}
	for (int n= 0; n < 3; n++)
	{
	cout << x[n][0] << ' ' << x[n][1] <<' '<< x[n][2] << 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);
  reverse(w,w+10);
  sort(k,k+10);
  reverse(k,k+10);

  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 x[10],i,j,y[10],ans1=0,ans2=0;
	for(i=0;i<10;i++){
		cin>>x[i];
	}
	sort(x,x+10);
	for(i=9;i>6;i--){
		ans1+=x[i];
	}
	for(j=0;j<10;j++){
		cin>>y[j];
	}
	sort(y,y+10);
	for(j=9;j>6;j--){
		ans2+=y[j];
	}
	cout<<ans1<<" "<<ans2<<endl;
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int w,a[11],b[11],x,i,j,k,kk,o=0,oo=0;
	for(i=1;i<=10;i++) scanf("%d",&a[i]);
	for(i=1;i<=10;i++) scanf("%d",&b[i]);
	for(i=1;i<10;i++){
		for(j=i+1;j<=10;j++){
			if(a[i]<a[j]){
				k=a[i];
				a[i]=a[j];
				a[j]=k;
			}
		}
	}
	for(i=1;i<=3;i++) o+=a[i];
	for(i=1;i<10;i++){
		for(j=i+1;j<=10;j++){
			if(b[i]<b[j]){
				kk=b[i];
				b[i]=b[j];
				b[j]=kk;
			}
		}
	}
	for(i=1;i<=3;i++) oo+=b[i];
	printf("%d %d\n",o,oo);
	return 0;
}