Cod sursa(job #1991338)
Utilizator | Data | 16 iunie 2017 12:26:18 | |
---|---|---|---|
Problema | Orase | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.27 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("orase.in");
ofstream out("orase.out");
int main()
{
int d, l, st = 0, dr = 0;
in >> d >> l;
while(in >> d >> l)
st = max(st, d + l),dr = max(dr, l - d);
out << st + dr;
}