Advertisement
rengetsu

Codeforces_116A

Jul 21st, 2018
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. //Codeforces 116A
  2. #include <iostream>
  3. using namespace std;
  4. int main()
  5. {
  6.     int n, out, in, a=0, max=0;
  7.     cin >> n;
  8.     for(int i=0;i<n;i++)
  9.     {
  10.         cin >> out >> in;
  11.         a-=out;
  12.         a+=in;
  13.         if(a>max){max=a;}
  14.     }
  15.     cout << max;
  16.     return 0;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement