Cod sursa(job #1710571)
Utilizator | Data | 29 mai 2016 12:15:11 | |
---|---|---|---|
Problema | Orase | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <fstream>
#include <cmath>
using namespace std;
ifstream f("orase.in");
ofstream g("orase.out");
int x,y,difmax,summax,c1,n,m,c2,c3,c4;
int main()
{
f>>n>>m;
while(f>>x>>y)
{
if(x+y>summax)
{
summax=x+y;
c1=x;
c2=y;
}
if(y-x>difmax)
{
difmax=abs(x-y);
c3=x;
c4=y;
}
}
g<<summax+difmax;
return 0;
}