Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define ll long long
- #define _test int _TEST; cin>>_TEST; while(_TEST--)
- int main()
- {
- _test
- {
- int n;
- cin>>n;
- int ans;
- int x = 0;
- for(int i=0; i<n; i++)
- {
- int a, b;
- cin>>a>>b;
- if(a > 10) continue;
- if(b > x)
- {
- x = b;
- ans = i+1;
- }
- }
- cout<<ans<<"\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment