Go: package main

import (
    "fmt"
    "sort"
)

type Player struct {
    Name int
    Score  int
}

type Place []Player

func (p Place) Len() int {
    return len(p)
}

func (p Place) Swap(i, j int) {
    p[i], p[j] = p[j], p[i]
}

func (p Place) Less(i, j int) bool {

	if p[i].Score == p[j].Score {
		return p[i].Name < p[j].Name
	} else {
		return p[i].Score > p[j].Score
	}
   
}

func DataEntry(n int) Place {
	var id, sc int
	var ranking Place
	var adding Player

	for i := 0; i < n; i++ {

		fmt.Scan(&id, &sc)

		adding.Name = id
		adding.Score = sc

		ranking = append(ranking, adding)
	}

	return ranking
}

func main() {
	var ranking Place
	var num int

		fmt.Scan(&num)
		ranking = DataEntry(num)
	
	sort.Sort(Place(ranking))
	fmt.Println(ranking[0].Name ,ranking[0].Score)
}

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


int main() {
	int a,v,maxa,maxv;
	maxv=0;
	int n;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a>>v;
		if(maxv<v){maxa=a;maxv=v;}
	}
	cout<<maxa<<" "<<maxv<<endl;
	return 0;
}

C++: #include<iostream>
int a,v,M;main(A){for(std::cin>>a;std::cin>>a>>v;)M<v&&(M=v)&(A=a);std::cout<<A<<" "<<M<<"\n";}

C++: #include<iostream>
main(a,v,A,V){for(std::cin>>A;std::cin>>a>>v;)V^v?V<v&&(V=v)&(A=a):A>a&&(A=a);std::cout<<A<<" "<<V<<"\n";}

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

int main()
{
  int a[21], b[21];
  int n;
  int max = 0;
  int min = 1000;
  cin >> n;
  for (int i = 1; i <= n; i++){
    cin >> a[i] >> b[i];
    if (b[i] >= max){
      max = b[i];
    }
  }
  
  for (int i = 1; i <= 6; i++){
    if (b[i] == max){
      if (min > i){
        min = i;
      }
    }
  }

  cout << min << " " << max << endl;

  return 0;

}

C++: #include <iostream>

using namespace std;

int main(){

	int n;
	int ary[101] , v[101];
	
	cin >> n;

	for(int i = 0; i < n; i++){
		cin >> ary[i];
		cin >> v[i];
	}

	for(int i = 0; i < n; i++){
		for(int j = 1; j < n - 1; j++){
			if(v[i] < v[j]){
				int tmp = v[i];
				v[i] = v[j];
				tmp = v[i];

				int tmpn = ary[i];
				ary[i] = ary[j];
				tmpn = ary[i];
			}
		}
	}

	cout << ary[0] << " " << v[0] << endl;

	return 0;
}

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

int main(void){

  int n;
  int max = -1;
  int num = 0;

  cin >> n;

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

    int a = 0,v = 0;

    cin >> a >> v;

    if( max < v ){
      
      max = v;
      num = a;

    }

  }

  cout << num << " " << max << endl;

  return 0;

}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
#include <numeric>
#include <sstream>
#include <queue>
#include <iomanip>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()
#define print(s) cout << (s) << endl

int main() {
    vector<pair<int,int>> w;
    int n;
    cin >> n;
    REP(i,n) {
        int a, v;
        cin >> a >> v;
        w.push_back(make_pair(100-v, a));
    }
    sort(w.begin(),w.end());
    cout << w[0].second << " " << 100-w[0].first << endl;
    return 0;
}

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) (r).begin(),(r).end()
#define gsort(st,en) sort((st),(en),greater<int>())
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using dict = map<string,int>;
using pii = pair<int,int> ;

constexpr int imax = ((1<<30)-1)*2+1 ;
constexpr int inf = 100000000;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0};
const int dx[] = {0,-1,0,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

template<typename T>
void Unique(vector<T> &v){
  sort(all(v));
  v.erase(unique(all(v)),v.end());
}

template<typename T>
T ston(string& str, T n){
  istringstream sin(str) ;
  T num ;
  sin >> num ;
  return num ;
}

void Ans(bool f){
  if(f) cout << "YES"<<endl;
  else cout << "NO"<<endl;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  map<int,int> m;
  int n;
  cin >> n;
  rep(i,n){
    m[i+1] = 0;
  }
  int a,v;
  rep(i,n){
    cin >> a >> v;
    m[a] += v;
  }
  int ma = 0;
  REP(i,1,n+1){
    if(ma < m[i]){
      a = i;
      ma = m[i];
    }
    cout << i << " " << m[i]<<endl;
  }
  cout << a << " " << ma << endl;
  return 0;
}

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

int main()
{
    int n;
    int g[20] = {}, p[20] = {};

    cin >> n;

    for( int i = 0; i < n; i++ )
        cin >> g[i] >> p[i];

    int max = -1;    
    for( int i = 0; i < 20; i++ )
    {
        if( max < p[i] )
            max = p[i];
    }

    int min = 1000;
    for( int i = 0; i < 20; i++ )
    {
        if( p[i] == max )
        {
            if( min > g[i] )
                min = g[i];
        }
    }

    cout << min << " " << max << endl;

    return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <climits>
#define MAX_N 20
using namespace std;
/*
struct Human {
    int no;
    int result;
};
 */
//typedef struct Human Human
typedef pair<int, int> Human;

int compareTo(const Human& a, const Human& b) {
    return(a.second > b.second);
}

int main(void) {
    int num = 1; cin >> num;
    Human table[MAX_N];
    for(int r = 0; r < num; r++) cin >> table[r].first >> table[r].second;
    sort(table, table+num, compareTo);
    
    int minNo = INT_MAX, minResult = INT_MAX;
    int topResult = table[0].second;
    for(int r = 0; r < num && (table[r].second == topResult); r++) {
        if(table[r].first < minNo) {
            minNo = table[r].first; minResult = table[r].second;
        }
    }
    cout << minNo << " " << minResult << endl;
    return(0);
}

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

int main(){

    int n;
    cin >> n;
    int A = 0, V = -1;
    for(int i = 0; i < n; i++){
        int a, v;
        cin >> a >> v;
        if(v > V){
            A = a;
            V = v;
        }
        if(v == V && a < A){
            A = a;
            V = v;
        }
    }
    cout << A << " " << V << endl;

    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
typedef pair<double,int> p;

int main(){
    vector<p> v;
    int n,num,data;
    v.clear();
    cin >> n;
    while(n--){
        cin >> num >> data;
        v.push_back(p(data,num));
    }
    sort(v.begin(),v.end());
    cout << v[n-1].second << ' ' << v[n-1].first << endl;
    
    return 0;
}

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

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

using namespace std;

int main(){
    int n;
    cin >> n;
    int s[100] = {0};

    rep(i,n){
        int a,v;
        cin >> a >> v;
        s[a] += v;
    }
    int ans=1;
    int sum=0;
    reep(i,1,n+1){
        if(sum<s[i]){
            ans = i;
            sum = s[i];
        }
    }

    printf("%d %d\n",ans, sum);
    return 0;
}