Cod sursa(job #2237013)

Utilizator Moise_AndreiMoise Andrei Moise_Andrei Data 31 august 2018 12:55:32
Problema Orase Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.28 kb
#include <bits/stdc++.h>
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;
    return 0;
}