Language: C++

#include<iostream>
#include<set>
using namespace std;
typedef long long li;
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

struct less1 {
  bool operator()(const pair<li,li>& p1, const pair<li,li>& p2) const{
    return p1.first+p1.second<p2.first+p2.second;
  }
};
struct less2 {
  bool operator()(const pair<li,li>& p1, const pair<li,li>& p2) const{
    return p1.second-p1.first<p2.second-p2.first;
  }
};

int main(){
  set<pair<li,li>,less1> sl1;
  set<pair<li,li>,less2> sl2;
  int n; cin >>n;
  rep(i,n){
    li x,y; cin >>x >>y;
    sl1.insert({x,y});
    sl2.insert({x,y});
  }
  auto itr1=sl1.begin(),itr2=sl1.end();
  itr2--;
  li ans=(itr2->first+itr2->second)-(itr1->first+itr1->second);
  if(df)print(ans);
  itr1=sl2.begin();itr2=sl2.end();
  itr2--;
  li a2=(itr2->second-itr2->first)-(itr1->second-itr1->first);
  if(df)print(a2);
  ans=max(ans,a2);

  print(ans);
}

#define df 0
#include<iostream>
#include<set>
using namespace std;
typedef long long li;
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

struct less1 {
  bool operator()(const pair<li,li>& p1, const pair<li,li>& p2) const{
    return p1.first+p1.second<p2.first+p2.second;
  }
};
struct less2 {
  bool operator()(const pair<li,li>& p1, const pair<li,li>& p2) const{
    return p1.second-p1.first<p2.second-p2.first;
  }
};

int main(){
  set<pair<li,li>,less1> sl1;
  set<pair<li,li>,less2> sl2;
  int n; cin >>n;
  rep(i,n){
    li x,y; cin >>x >>y;
    sl1.insert({x,y});
    sl2.insert({x,y});
  }
  auto itr1=sl1.begin(),itr2=sl1.end();
  itr2--;
  li ans=(itr2->first+itr2->second)-(itr1->first+itr1->second);
  if(df)print(ans);
  itr1=sl2.begin();itr2=sl2.end();
  itr2--;
  li a2=(itr2->second-itr2->first)-(itr1->second-itr1->first);
  if(df)print(a2);
  ans=max(ans,a2);

  print(ans);
}



Compiler output:
a.cc:50:24: error: redefinition of 'template<class T> void print(const T&)'
   50 | template<class T> void print(const T& t){ cout << t << "\n"; }
      |                        ^~~~~
a.cc:7:24: note: 'template<class T> void print(const T&)' previously declared here
    7 | template<class T> void print(const T& t){ cout << t << "\n"; }
      |                        ^~~~~
a.cc:51:37: error: redefinition of 'template<class T, class ... Ts> void print(const T&, const Ts& ...)'
   51 | template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }
      |                                     ^~~~~
a.cc:8:37: note: 'template<class T, class ... Ts> void print(const T&, const Ts& ...)' previously declared here
    8 | template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }
      |                                     ^~~~~
a.cc:53:8: error: redefinition of 'struct less1'
   53 | struct less1 {
      |        ^~~~~
a.cc:10:8: note: previous definition of 'struct less1'
   10 | struct less1 {
      |        ^~~~~
a.cc:58:8: error: redefinition of 'struct less2'
   58 | struct less2 {
      |        ^~~~~
a.cc:15:8: note: previous definition of 'struct less2'
   15 | struct less2 {
      |        ^~~~~
a.cc:64:5: error: redefinition of 'int main()'
   64 | int main(){
      |     ^~~~
a.cc:21:5: note: 'int main()' previously defined here
   21 | int main(){
      |     ^~~~