Cod sursa(job #2409490)

Utilizator Briana_NeaguNeagu Briana Briana_Neagu Data 19 aprilie 2019 09:12:22
Problema Orase Scor 100
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.31 kb
#include <iostream>
#include <fstream>



using namespace std;



ifstream f("orase.in");
ofstream g("orase.out");

int n,m,l,d,max1,max2;

int main()
{
  f>>m>>n;

  for (int i=1;i<=n;i++)
  {
      f>>d>>l;
      max1=max(max1,l-d);
      max2=max(max2,l+d);
  }
  g<<max1+max2;



}