initial commit

This commit is contained in:
ShazidMahsrafi 2023-06-14 02:19:08 +06:00
parent 597abdcede
commit 7a841a428e

26
116A Tram/116A.cpp Normal file
View File

@ -0,0 +1,26 @@
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve()
{
int n,a,b,min=0,p=0;
cin>>n;
while(n--)
{
cin>>a>>b;
p=p-a+b;
if(p>min) min=p;
}
cout<<min<<endl;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int TC = 1;
//cin >> TC;
while (TC--) solve();
}