Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define fastread()(ios_base::sync_with_stdio(false),cin.tie(NULL));
- int main()
- {
- fastread();
- int n,mx=0,sum=0;
- cin>>n;
- while(n--)
- {
- int a,b;
- cin>>a>>b;
- sum+=b;
- sum-=a;
- mx=max(sum,mx);
- }
- cout<<mx<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement