Language: C++

#include <bits/stdc++.h>
using namespace std;

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

int main(void){
	int32 N;
	cin >> N;
	vector<int64> x(N), y(N), h(N);
	REP(i, N){
		cin >> x[i] >> y[i] >> h[i];
		if(N == 1){
			cout << x[i] << " " << y[i] << " " << h[i] << endl;
			return 0;
		}
		int64 X = x[i]+y[i], Y = x[i]-y[i];
		x[i] = X; y[i] = Y;
	}
	REP(i, 101){
		REP(j, 101){
			int64 xx = i+j, yy = i-j;
			int64 H = max(abs(xx-x[0]), abs(yy-y[0]))+h[0];
			bool ok = 1;
			REP(k, N){
				if(h[k] != max(0LL, H-max(abs(xx-x[k]), abs(yy-y[k])))){
					ok = 0;
				}
			}
			if(ok){
				cout << i << " " << j << " " << H << endl;
				return 0;
			}
		}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:43:47: error: no matching function for call to 'max(long long int, int64)'
   43 |                                 if(h[k] != max(0LL, H-max(abs(xx-x[k]), abs(yy-y[k])))){
      |                                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from /usr/include/x86_64-linux-gnu/c++/14/bits/stdc++.h:51,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_algobase.h:257:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::max(const _Tp&, const _Tp&)'
  257 |     max(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:257:5: note:   template argument deduction/substitution failed:
a.cc:43:47: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int64' {aka 'long int'})
   43 |                                 if(h[k] != max(0LL, H-max(abs(xx-x[k]), abs(yy-y[k])))){
      |                                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)'
  303 |     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algobase.h:303:5: note:   candidate expects 3 arguments, 2 provided
In file included from /usr/include/c++/14/algorithm:61:
/usr/include/c++/14/bits/stl_algo.h:5706:5: note: candidate: 'template<class _Tp> constexpr _Tp std::max(initializer_list<_Tp>)'
 5706 |     max(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5706:5: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/14/bits/stl_algo.h:5716:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::max(initializer_list<_Tp>, _Compare)'
 5716 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/14/bits/stl_algo.h:5716:5: note:   template argument deduction/substitution failed:
a.cc:43:47: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   43 |                                 if(h[k] != max(0LL, H-max(abs(xx-x[k]), abs(yy-y[k])))){
      |                                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~