Cod sursa(job #3133921)

Utilizator LORDENVraja Luca LORDEN Data 27 mai 2023 15:55:38
Problema Orase Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.42 kb
#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 ;
}