#include <cstdio>
#include <iostream>
using namespace Std;
#define N 100001
Long Long A[n],b[n],maxx;
int n;
BOOL Check (long long x)
{
Long Long carry=0;
for (int j=1; j<n; j + +)//Well, n towns ah ~
{
What does carry=carry+b[j]-x;//0.0 carry do? It seems to be a larger or smaller record than (beep).
if (carry<0)//
carry=carry-a[j+1]-a[j];//╮(╯▽╰)╭ Look at this expression to know ...
Else
if (Carry<a[j+1]-a[j])//compare tolls Ah, transported past the fish all when the tolls ... Is that interesting?
carry=0;
Else
CARRY-=A[J+1]-A[J]; No matter how much or what it is when it is more than shipping
}
Return carry+b[n]>=x;//when the value is larger than x, it means X is small, so change
}
int main ()
{
scanf ("%d", &n);
for (int i=1; i<=n; i++)
{
cin>>a[i]>>b[i];
Maxx=max (Maxx,b[i]);//Find out the largest number of fishing
}
Long Long l=1,r=maxx,mid;
while (L<=R)//start two points
{
Mid= (l+r) >>1;
if (check (mid))//Check AH ~
l=mid+1;
Else
R=mid-1;
}
cout<<l-1<<endl;//why is L-1?! Actually R is ok ... But I don't know why
return 0;
}
Fish Feed sister paper (see my notes how cute (hehe))