Pagini recente » Cod sursa (job #1017529) | Cod sursa (job #365939) | Cod sursa (job #1244979) | Diferente pentru problema/emm intre reviziile 6 si 5 | Cod sursa (job #3133920)
#include <iostream>
#include <unordered_map>
#include <vector>
#include <algorithm>
using namespace std ;
int main()
{
int m, n, leftmin = 1e9, rightmax = 0, x, y ;
cin >> m >> n ;
for (int i = 1 ; i <= n ; i ++)
{
cin >> x >> y ;
leftmin = min (leftmin, x - y) ;
rightmax = max (rightmax, x + y) ;
}
cout << rightmax - leftmin ;
return 0 ;
}