Cod sursa(job #2365579)

Utilizator Xutzu358Ignat Alex Xutzu358 Data 4 martie 2019 14:54:28
Problema Orase Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.32 kb
#include <bits/stdc++.h>
using namespace std;
ifstream f("orase.in");
ofstream g("orase.out");
int n,m,c1,c2,max1,max2,l1,l2;
int main()
{
    f >> m >> n;
    for (int i=1;i<=n;i++) {
        f >> c1 >> c2;
        max2=max(max2, c1+c2);
        max1=max(max1 , c2-c1);
    }
    g << max1+max2;
    return 0;
}