Cod sursa(job #2434412)
| Utilizator | Data | 1 iulie 2019 18:53:24 | |
|---|---|---|---|
| Problema | Orase | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<iostream>
#include<fstream>
using namespace std;
ifstream fin("orase.in");
ofstream fout("orase.out");
int n,m,l,d,i;
int maximus(int x,int y){
if(x<y)
return y;
else
return x;
}
int main(){
fin>>m>>n;
int max1=0,max2=0;
for(i=1;i<=n;++i){
fin>>d>>l;
max1=maximus(max1,d+l);
max2=maximus(max2,l-d);
}
int rez=max1+max2;
fout<<max1+max2;
}
