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>
using namespace std;
// #define int long long
typedef long long ll;
typedef pair<int,int> pii;
#define ITR(v,c) for(auto v=begin(c);v!=end(c);v++)
#define FOR(v,a,n) for(int v=a;v<(int)(n);v++)
#define FORE(x,arr) for(auto &x:arr)
#define REP(v,n) FOR(v,0,n)
#define RREP(v,n) for(int v=(int)(n);v>=0;v--)
#define ALL(c) begin(c),end(c)
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
const int INF = 1e9;
const ll INFLL = 1e18;
template<class T,class U>ostream&operator<<(ostream &os,const pair<T,U> &p){
    os<<"("<<p.first<<","<<p.second<<")";return os;}
template<class T>ostream&operator<<(ostream &os,const vector<T> &v){
    ITR(i,v)os<<*i<<(i==end(v)-1?"":" ");return os;}
//------------------------------------------------------------------------------

signed main() {
    vector<int> a(10),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;
    return 0;
}

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

int main(){


int score[20]={};


for(int i=0;i<10;i++){
  cin >> score[i];
 }
 sort(score, score+10);


 int score2[20]={};

for(int i=0;i<10;i++){
  cin >> score2[i];
 }
 sort(score2,score2+10);

int  sum1=score[9]+score[8]+score[7];
int  sum2=score2[9]+score2[8]+score2[7];

 cout << sum1 << ' '<< sum2 << endl;

}

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

int main() {
	array<array<int,10>,2> ar;
	for(int i = 0; 2 > i; i++){
		for(int j = 0; 10 > j; j++){
			scanf("%d\n", &ar[i][j]);
		}
		sort(ar[i].begin(), ar[i].end(), [](int a, int b){return a > b;});
	}
	printf("%d %d\n", accumulate(ar[0].begin(), ar[0].begin()+3, 0), accumulate(ar[1].begin(), ar[1].begin()+3, 0));
	return 0;
}

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

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];
    partial_sort(w.begin(), w.begin()+3, w.end(), greater<int>());
    partial_sort(k.begin(), k.begin()+3, k.end(), greater<int>());
    cout << w[0]+w[1]+w[2] << " " << k[0]+k[1]+k[2] << endl;
    return 0;
}

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<<" "<<d<<endl;
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
  int a,w[10]={},k[10]={},wa,ke;
  for(int i=0; i<10; i++) {
      cin >> a;
      w[i]=a;
  }
  sort(w,w+10);
  wa=w[9]+w[8]+w[7];
  cout << wa << " ";
  for(int i=0; i<10; i++) {
      cin >> a;
      k[i]=a;
  }
  sort(k,k+10);
  ke=k[9]+k[8]+k[7];
  cout << ke << endl;
}

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

int main(){
	int w[10], k[10], w_ans, k_ans;
	for(int i = 0; i < 10; i++){
		cin >> w[i];
	}
	sort(w,w+10,greater<int>());
	w_ans = w[0] + w[1] + w[2];

	for(int i = 0; i < 10; i++){
		cin >> k[i];
	}
	sort(k,k+10,greater<int>());
	k_ans = k[0] + k[1] + k[2];

	cout << w_ans << " " << k_ans << endl;


}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype

template <class T>
int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

template <class T> void max_swap(T& a, const T b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T b) { a = min(a, b); }

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


int main()
{
	for (int t = 0; t < 2; ++t)
	{
		int a[10];
		for (int i = 0; i < 10; ++i)
			scanf("%d", a + i);
		sort(a, a + 10);
		printf("%d%c", accumulate(a + 7, a + 10, 0), t ? ' ' : '\n');
	}
}

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

using namespace std;

int main(){

  int w1=0;
  int w2=0;
  int w3=0;
  int k1=0;
  int k2=0;
  int k3=0;
  int temp;
  
  for(int i=0;i<10;++i){
	cin>>temp;
	if(w1<temp){
	  w1=temp;
	  continue;
	}
	else if(w2<temp){
	  w2=temp;
	  continue;
	}
	else if(w3<temp){
	  w3=temp;
	  continue;
	}
	
  }

  for(int i=0;i<10;++i){
	cin>>temp;
	if(k1<temp){
	  k1=temp;
	  continue;
	}
	else if(k2<temp){
	  k2=temp;
	  continue;
	}
	else if(k3<temp){
	  k3=temp;
	  continue;
	}
	
  }

  cout<<w1+w2+w3<<" "<<k1+k2+k3<<endl;

  return 0;
  
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main (){
  
  int W[10],K[10],s1,s2;

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

  s1=W[9]+W[8]+W[7];
  s2=K[9]+K[8]+K[7];

  cout <<s1<<" "<<s2<<endl;

  return 0;

}

C++: #include <iostream>
using namespace std;
int main(void){
int a,b,c,d,e,f,i,g;
a=0;
b=0;
c=0;
d=0;
e=0;
f=0;
for (i=1;i<=10;i++){
cin>>g;
if(a<=g){
c=b;
b=a;
a=g;
}else if(b<=g){
c=b;
b=g;
}else if(c<=g){
c=g;
}
}
for (i=1;i<=10;i++){
cin>>g;
if(d<=g){
f=e;
e=d;
d=g;
}else if(e<=g){
f=e;
e=g;
}else if(f<=g){
f=g;
}
}
cout<<a+b+c<<" "<<d+e+f<<endl;
}

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

int w[10];
int k[10];
int main(){

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 <algorithm>
using namespace std;
int main(){
  int w[10];
  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,w+10);
  sort(k,k+10);

  int sw=0, sk=0;
  for( int i=0;i<3;i++ ){
    sw += w[i+7];
    sk += k[i+7];
  }
  cout << sw << " " << sk << endl;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>

using namespace std;
int main(void){
   vector<int> w(10);
   vector<int> k(10);
   int sumw=0,sumk=0;
   
   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());
   
   for(int i=9;i>6;i--) {
       sumw+=w[i];
       sumk+=k[i];
   }
        
    cout<<sumw<<" "<<sumk<<endl;
    
    
    return 0;
}

C++: /*
	0533:Contest
*/
#include	<iostream>
#include	<queue>

using namespace std;

int main(void) {
	priority_queue<int> W;
	priority_queue<int> K;
	int WP, KP, tops[2][3];
	
	for(int i = 0; i < 10; i++) {
		int p;
		cin >> p;
		W.push( p );
	}
	for(int j = 0; j < 3; j++) {
		tops[0][j] = W.top();
		W.pop();
	}
	WP = tops[0][0] + tops[0][1] + tops[0][2];
	
	for(int i = 0; i < 10; i++) {
		int p;
		cin >> p;
		K.push( p );
	}
	for(int j = 0; j < 3; j++) {
		tops[1][j] = K.top();
		K.pop();
	}
	KP = tops[1][0] + tops[1][1] + tops[1][2];
	
	cout << WP << ' ' << KP << endl;
	
	return 0;
}