jakaria_hossain

codeforce - tram

Apr 3rd, 2019
79
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. #define fastread()(ios_base::sync_with_stdio(false),cin.tie(NULL));
  4. int main()
  5. {
  6. fastread();
  7. int n,mx=0,sum=0;
  8. cin>>n;
  9. while(n--)
  10. {
  11. int a,b;
  12. cin>>a>>b;
  13. sum+=b;
  14. sum-=a;
  15. mx=max(sum,mx);
  16. }
  17. cout<<mx<<endl;
  18. return 0;
  19. }
RAW Paste Data