Cod sursa(job #2292506)
Utilizator | Data | 29 noiembrie 2018 17:28:20 | |
---|---|---|---|
Problema | Orase | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("orase.in");
ofstream out("orase.out");
int main()
{
int a, b, n, mx = 0, mx2 = 0;
in >> n >> n;
for(int i = 1; i <= n; i ++)
{
in >> a >> b;
mx = max(mx, a + b), mx2 = max(mx2, b - a);
}
out << mx + mx2;
return 0;
}