Pagini recente » Diferente pentru problema/grafc intre reviziile 12 si 11 | Cod sursa (job #2284813) | Cod sursa (job #2277146) | Cod sursa (job #2280890) | Cod sursa (job #3131811)
#include <bits/stdc++.h>
#define DIM 250001
using namespace std;
ifstream fin ("orase.in");
ofstream fout ("orase.out");
int n,m;
int stgmin=1000001,drmax=-1000001;
int Di,Li;
int main ()
{
fin >> n >> m;
for (int i=1;i<=m;i++)
{
fin >> Di >> Li;
drmax=max(Di+Li,drmax);
stgmin=min(Di-Li,stgmin);
}
fout << drmax-stgmin;
return 0;
}