Codeforces-SolutionsA/Codes/1850 B - Ten Words of Wisdom/1850B.cpp

34 lines
486 B
C++
Raw Permalink Normal View History

2023-08-03 04:42:39 +08:00
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
int n;
cin>>n;
map<int,int>ans;
int max=0;
for(int i=1; i<=n; ++i)
{
int x,y;
cin>>x>>y;
if(x<=10)
{
ans[y]=i;
}
}
auto it=ans.rbegin();
cout<<it->second<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int TC = 1;
cin >> TC;
cin.ignore();
while (TC--) solve();
}