Pagini recente » Cod sursa (job #1122898) | Cod sursa (job #2541848) | Cod sursa (job #2635990) | Cod sursa (job #2796358) | Cod sursa (job #3184166)
/*
* Lefter Sergiu - 14/12/2023
*/
#include <fstream>
using namespace std;
ifstream in("orase.in");
ofstream out("orase.out");
const int INF = 2e9;
int main() {
int n, m, sc, smax = -INF, maxi1 = -INF, maxi2 = -INF;
in >> n >> m;
for (int i = 1; i <= m; ++i) {
int x, y;
in >> x >> y;
maxi1 = max(maxi1, x + y);
maxi2 = max(maxi2, y - x);
}
out << maxi1 + maxi2;
in.close();
out.close();
return 0;
}