T3000

Untitled

Mar 9th, 2022
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. using ll = long long;
  5.  
  6. int main()
  7. {
  8.     ll n;
  9.     cin >> n;
  10.     ll mn = 1e9, mx = -1;
  11.     while (n-- > 0)
  12.     {
  13.         ll a, b;
  14.         cin >> a >> b;
  15.         mn = min(a, mn);
  16.         mx = max(b, mx);
  17.         cout << mn + mx << endl;
  18.     }
  19.  
  20.     return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment