Cod sursa(job #1710681)

Utilizator circeanubogdanCirceanu Bogdan circeanubogdan Data 29 mai 2016 16:52:52
Problema Orase Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.29 kb
#include <fstream>
using namespace std;
ifstream f("orase.in");
ofstream g("orase.out");
int x,y,difmax,summax,n,m;
int main()
{
    f>>n>>m;
    while(f>>x>>y)
    {
        if(x+y>summax) summax=x+y;
        if(y-x>difmax) difmax=x-y;
    }
    g<<summax+difmax;
    return 0;
}