Cod sursa(job #1835485)
Utilizator | Data | 26 decembrie 2016 22:27:24 | |
---|---|---|---|
Problema | Orase | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
#include <iostream>
#include <cmath>
#include <fstream>
using namespace std;
ifstream fin("orase.in");
ofstream fout("orase.out");
int main() {
int n, m, i, max1, max2, x, y;
fin>>n>>m;
for(i=1; i<=m; i++) {
fin>>x>>y;
while(max1<x+y)
{
max1=x+y;
}
while(max2<y-x)
{
max2=y-x;
}
}
fout<<max1+max2;
return 0;
}