Language: C++

// in case of multiple test cases and N=1e5 don't intialize arrays as global except for graph vector-array
// always check whether or not you are doing mod of a negative number
// always use 1LL instead of 1
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
 
using namespace __gnu_pbds;
using namespace std;

// using long doubles saves you from corner cases but is very time consuming
#define double      	long double
#define int         	long long
#define pb          	push_back
#define pii         	pair<int,int>
#define vi          	vector<int>
#define vii         	vector<pii>
#define mi          	map<int,int>
#define mii         	map<pii,int>
#define all(a)      	(a).begin(),(a).end()
#define sz(x)       	(int)x.size()
// just comment the line below in case of interactive problems
#define endl        	"\n"
#define repp(i,a,b) 	for(int i=a;i<b;i++)
#define rep(i,a,b) 		for(int i=a;i<=b;i++)
#define brep(i,a,b)     for(int i=a;i>=b;i--)
#define deb1(x)      	cout << #x << "=" << x << endl
#define deb2(x, y)  	cout << #x << "=" << x << "," << #y << "=" << y << endl
#define deb3(x, y, z)  	cout << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define trace(v) 		for(auto it=v.begin();it!=v.end();it++)cout<<*it<<" ";cout<<endl;
#define tracearr(a,l,r) for(int iii=l;iii<=r;iii++)cout << a[iii] << " ";cout << endl;
#define PI          	3.1415926535897932384626
#define F 				first
#define S 				second
#define clr(x,y) 		memset(x, y, sizeof(x))
#define IOS         	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);


typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
// *s.find_by_order(1) - gives the 2nd samllest element in set
// s.order_of_key(x)   - gives the number of elements in the set which are strictly smaller than x


const int N=1e5 + 5;
const int MOD=1e9 + 7;

struct data{
	int x;
	int y;
	int val;
};

bool comp(data a,data b){
	return a.val < b.val;
}

int32_t main()
{
	IOS;
	int T=1;
	//cin >> T;
	// int numOfSetBits = __builtin_popcountll(n);
	std::cout << std::fixed << std::setprecision(12);
	while(T--)
	{
		int n;
		cin >> n;
		vector<data> v1;
		vector<data> v2;
		rep(i,1,n)
		{
			int xx;int yy;
			cin >> xx >> yy;
			data a;
			a.x = xx;
			a.y = yy;
			a.val = xx + yy;
			v1.pb(a);
			a.val = xx - yy;
			v2.pb(a);
		}
		sort(all(v1),comp);
		sort(all(v2),comp);
		int ans1 = abs(v1[0].x - v1[n-1].x) + abs(v1[0].y - v1[n-1].y);
		int ans2 = abs(v2[0].x - v2[n-1].x) + abs(v2[0].y - v2[n-1].y);
		cout << max(ans1,ans2);
	}
}

Compiler output:
a.cc:53:11: error: reference to 'data' is ambiguous
   53 | bool comp(data a,data b){
      |           ^~~~
In file included from /usr/include/c++/14/vector:69,
                 from /usr/include/c++/14/ext/pb_ds/hash_policy.hpp:46,
                 from /usr/include/c++/14/ext/pb_ds/detail/standard_policies.hpp:45,
                 from /usr/include/c++/14/ext/pb_ds/assoc_container.hpp:47,
                 from a.cc:4:
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:47:8: note:                 'struct data'
   47 | struct data{
      |        ^~~~
a.cc:53:18: error: reference to 'data' is ambiguous
   53 | bool comp(data a,data b){
      |                  ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:47:8: note:                 'struct data'
   47 | struct data{
      |        ^~~~
a.cc:53:24: error: expression list treated as compound expression in initializer [-fpermissive]
   53 | bool comp(data a,data b){
      |                        ^
a.cc: In function 'int32_t main()':
a.cc:68:28: error: template argument 1 is invalid
   68 |                 vector<data> v1;
      |                            ^
a.cc:68:28: error: template argument 2 is invalid
a.cc:69:28: error: template argument 1 is invalid
   69 |                 vector<data> v2;
      |                            ^
a.cc:69:28: error: template argument 2 is invalid
a.cc:74:25: error: reference to 'data' is ambiguous
   74 |                         data a;
      |                         ^~~~
/usr/include/c++/14/bits/range_access.h:344:5: note: candidates are: 'template<class _Tp> constexpr const _Tp* std::data(initializer_list<_Tp>)'
  344 |     data(initializer_list<_Tp> __il) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:334:5: note:                 'template<class _Tp, long unsigned int _Nm> constexpr _Tp* std::data(_Tp (&)[_Nm])'
  334 |     data(_Tp (&__array)[_Nm]) noexcept
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:323:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(const _Container&)'
  323 |     data(const _Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
/usr/include/c++/14/bits/range_access.h:312:5: note:                 'template<class _Container> constexpr decltype (__cont.data()) std::data(_Container&)'
  312 |     data(_Container& __cont) noexcept(noexcept(__cont.data()))
      |     ^~~~
a.cc:47:8: note:                 'struct data'
   47 | struct data{
      |        ^~~~
a.cc:75:25: error: 'a' was not declared in this scope
   75 |                         a.x = xx;
      |                         ^
a.cc:14:25: error: request for member 'push_back' in 'v1', which is of non-class type 'int'
   14 | #define pb              push_back
      |                         ^~~~~~~~~
a.cc:78:28: note: in expansion of macro 'pb'
   78 |                         v1.pb(a);
      |                            ^~
a.cc:14:25: error: request for member 'push_back' in 'v2', which is of non-class type 'int'
   14 | #define pb              push_back
      |                         ^~~~~~~~~
a.cc:80:28: note: in expansion of macro 'pb'
   80 |                         v2.pb(a);
      |                            ^~
a.cc:20:29: error: request for member 'begin' in 'v1', which is of non-class type 'int'
   20 | #define all(a)          (a).begin(),(a).end()
      |                             ^~~~~
a.cc:82:22: note: in expansion of macro 'all'
   82 |                 sort(all(v1),comp);
      |                      ^~~
a.cc:20:41: error: request for member 'end' in 'v1', which is of non-class type 'int'
   20 | #define all(a)          (a).begin(),(a).end()
      |                                         ^~~
a.cc:82:22: note: in expansion of macro 'all'
   82 |                 sort(all(v1),comp);
      |                      ^~~
a.cc:20:29: error: request for member 'begin' in 'v2', which is of non-class type 'int'
   20 | #define all(a)          (a).begin(),(a).end()
      |                             ^~~~~
a.cc:83:22: note: in expansion of macro 'all'
   83 |                 sort(all(v2),comp);
      |                      ^~~
a.cc:20:41: error: request for member 'end' in 'v2', which is of non-class type 'int'
   20 | #define all(a)          (a).begin(),(a).end()
      |                                         ^~~
a.cc:83:22: note: in expansion of macro 'all'
   83 |                 sort(all(v2),comp);
      |                      ^~~
a.cc:84:34: error: invalid types 'int[int]' for array subscript
   84 |                 int ans1 = abs(v1[0].x - v1[n-1].x) + abs(v1[0].y - v1[n-1].y);
      |                                  ^
a.cc:84:44: error: invalid types 'int[long long int]' for array subscript
   84 |                 int ans1 = abs(v1[0].x - v1[n-1].x) + abs(v1[0].y - v1[n-1].y);
      |                                            ^
a.cc:84:61: error: invalid types 'int[int]' for array subscript
   84 |                 int ans1 = abs(v1[0].x - v1[n-1].x) + abs(v1[0].y - v1[n-1].y);
      |                                                             ^
a.cc:84:71: error: invalid types 'int[long long int]' for array subscript
   84 |                 int ans1 = abs(v1[0].x - v1[n-1].x) + abs(v1[0].y - v1[n-1].y);
      |                                                                       ^
a.cc:85:34: error: invalid types 'int[int]' for array subscript
   85 |                 int ans2 = abs(v2[0].x - v2[n-1].x) + abs(v2[0].y - v2[n-1].y);
      |                                  ^
a.cc:85:44: error: invalid types 'int[long long int]' for array subscript
   85 |                 int ans2 = abs(v2[0].x - v2[n-1].x) + abs(v2[0].y - v2[n-1].y);
      |                                            ^
a.cc:85:61: error: invalid types 'int[int]' for array subscript
   85 |                 int ans2 = abs(v2[0].x - v2[n-1].x) + abs(v2[0].y - v2[n-1].y);
      |                                                             ^
a.cc:85:71: error: invalid types 'int[long long int]' for array subscript
   85 |                 int ans2 = abs(v2[0].x - v2[n-1].x) + abs(v2[0].y - v2[n-1].y);
      |                                                                       ^