Pagini recente » Cod sursa (job #1656116) | Cod sursa (job #1063384) | Cod sursa (job #2022454) | Diferente pentru problema/bitconnect intre reviziile 18 si 17 | Cod sursa (job #3133921)
#include <fstream>
using namespace std ;
ifstream cin ("orase.in") ;
ofstream cout ("orase.out") ;
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 ;
}