fork download
  1. #include <iostream>
  2. #include <algorithm>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. int n, a, b, x,y=1001;
  8.  
  9. cin>>n;
  10.  
  11. for(int i=0;i<n;i++){
  12. cin>>a>>b;
  13.  
  14. if(y>b){
  15. y=b;
  16. x=a;
  17. }
  18. }
  19.  
  20. cout<<x<<' '<<y;
  21.  
  22. return 0;
  23. }
Success #stdin #stdout 0.01s 5284KB
stdin
4
10 5
6 -3
3 2
4 2
stdout
6 -3