Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Codeforces 116A
- #include <iostream>
- using namespace std;
- int main()
- {
- int n, out, in, a=0, max=0;
- cin >> n;
- for(int i=0;i<n;i++)
- {
- cin >> out >> in;
- a-=out;
- a+=in;
- if(a>max){max=a;}
- }
- cout << max;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement