Cod sursa(job #2411328)
Utilizator | Data | 20 aprilie 2019 18:11:53 | |
---|---|---|---|
Problema | Orase | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <fstream>
#include <algorithm>
#include <cmath>
using namespace std;
ifstream f("orase.in");
ofstream g("orase.out");
int m,n,m1,m2;
int main()
{
f>>m>>n;
for(int i=1;i<=n;i++)
{
int x,l;
f>>x>>l;
m1=max(m1,x+l);
m2=max(m2,l-x);
}
g<<m1+m2<<'\n';
return 0;
}