fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int t;
  6. int max = 0;;
  7. int minPerson;
  8. int curr,person;
  9. cin>>t;
  10. while(t--){
  11. int i,j;
  12. cin>>i>>j;
  13. if(i>=j){
  14. curr = i-j;
  15. person = 1;
  16. } else {
  17. curr = j-i;
  18. person = 2;
  19. }
  20. if(curr>max){
  21. max = curr;
  22. minPerson = person;
  23. }
  24. }
  25. cout<<minPerson<<max<<endl;
  26. return 0;
  27. }
  28.  
Success #stdin #stdout 0s 4272KB
stdin
5
140 82
89 134
90 110
112 106
88 90
stdout
158