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 <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#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>
#include <functional>
using namespace std;

int main()
{
    int n;
    cin >> n;

    vector<int> v(n);
    for(int i=0; i<n; ++i){
        int a;
        cin >> a;
        cin >> v[a-1];
    }

    vector<int>::iterator it = max_element(v.begin(), v.end());
    cout << (it - v.begin() + 1) << ' ' << *it << endl;

    return 0;
}

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

int main()
{
  int a[21], b[21];
  int n;
  int max = 0;
  int mx;
  cin >> n;
  for (int i = 1; i <= n; i++){
    cin >> a[i] >> b[i];
    if (b[i] >= max){
      max = b[i];
    }
  }
  int i = 0;
  while (1){
    if (b[i] == max){
      cout << mx << " " << max << endl;
      i++;
      break;
    }
  }


  return 0;

}

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

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <sstream>
#include <algorithm>
#include <math.h>
#include <map>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>

#define PI 3.14159265359

#define INF 99999999;

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

typedef long long ll;

using namespace std;



/*
class TheKingsArmyDiv2
{
public:
	int getNumber(vector <string> state)
	{

	}
};
*/




int main()
{
	int n;
	
	cin >> n;
	pair<int, int> va[n];
	
	REP(n)
	{
		cin >> va[i].second >> va[i].first;
	}
	
	sort(va, va + n, greater<pair<int, int> >());
	
	cout << va[0].second << " " << va[0].first << endl;
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

int main(){
    int n;cin>>n;
    vector<pair<int,int>> v(n);
    
    rep(i,0,n){
        cin>>v[i].se>>v[i].fi;
    }
    Sort(v);
    cout<<v[n-1].se<<" "<<v[n-1].fi<<endl;

    return 0;
}

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

int main() {
	int n;
	int max[2];
	int a, b;
	cin >> n;
	cin >> max[0] >> max[1];
	for (int i = 1; i < n; i++) {
		cin >> a >> b;
		if (b > max[1]) {
			max[1] = b;
			max[0] = a;
		} else if (b == max[1]) {
			max[0] = min(max[0], a);
		}
	}
	cout << max[0] << " " << max[1] << endl;
	return 0;
}

C++: // #define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>	// istringstream
using namespace std;

int main(){
	int n, max = 0, ans = 0;
	int bangou = 0, num = 0;
	map<int, int> list;

	cin >> n;
	for (int i = 0; i < n; i++){
		cin >> bangou >> num;
		if (max < num){
			max = num;
			ans = bangou;
		}
	}
	cout << ans << " " << max;

	return 0;
}

C++: #include <iostream>

using namespace std;

int info[22];

int main()
{
    int n, a, v;
    int max_idx = -1;

    cin >> n;
    cerr << n << endl;;

    for (int i = 0; i < n; i++) {
        cin >> a >> v;
        cerr << a << " " << v << endl;
        info[a] = v;
    }
    
    // for (int i = 1; i <= n; i++)
    //     if (info[max_idx] < info[i])
    //         max_idx = i;
    // cout << max_idx << " " << info[max_idx] << endl;
    

    return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[2]{};
	for(int i=0;i<n;i++){
		int b,c;
		cin>>b>>c;
		if(c>a[1]){
			a[0]=b;
			a[1]=c;
		}
	}
	cout<<a[0]<<" "<<a[1]<<endl;
}

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

int main(){
	int n,a[20],b[20],k;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> a[i] >> b[i];
	}
	for(int j=1;j<n;j++){
		for(int i=0;i<n-j;i++){
			if(b[i]<b[i+1]){
				k=b[i];b[i]=b[i+1];b[i+1]=k;
				k=a[i];a[i]=a[i+1];a[i+1]=k;
			}
		}
	}
	cout << a[0] <<" "<< b[0] <<"\n";
return 0;
}

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

int main(){
  int n,m,max=0;
  scanf("%d",&n);
  int data[n];
  int num[n];
  for(int i=0;i<n;i++){
    scanf(" %d %d",&num[i],&data[i]);
    if(data[i]>max){
      max=data[i];
    }
  }
  
  for(int i=0;i<n;i++){
    if(max == data[i]){
      printf("%d %d\n",num[i],max);
      break;
    }
  }

  return(0);
}

C++: #include<iostream>

using namespace std;

int main(){
  int A,B=-1;

  int n;
  cin >> n;
  while(n--){
    int a,b;
    cin >> a >> b;

    if(B < b || B == b && A > a){
      A = a;
      B = b;
    }
  }
  cout << A << " " << B << endl;

  return 0;
}

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

int main(){

	int n;
	int num[20];
	int fish[100];
	int ans1 = 0;
	int ans2;

	cin >> n;

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

	for (int i = 0; i < n; i++){
		if (fish[i] > ans1){
			ans1 = fish[i];
			ans2 = i + 1;
			if (ans2 > i + 1){
				ans2 = i + 1;
			}
		}
	}

	cout << ans2 << " " << ans1 << endl;

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int n,a,b,ma=1,sum=0;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a >> b;
        if(b > sum || b == sum && a < ma){
            ma = a;
            sum = b;
        }
    }
    cout << ma << " " << sum << endl;
    return(0);
}