Language: C++

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

using ll    = long long;
using ull   = unsigned long long;
using veci  = vector<int>;
using vecll = vector<ll>;
#define EPS (1e-7)
#define INF (1e9)
#define PI  (acos(-1))
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define REP(i,n) for(int i= 0;i<(int)(n);++i)
#define pb push_back

veci enum_div(int n){
	veci ret;
	ret.pb(1);
	for(int i=1;i*i<n;i++){
		if(n%i==0){
			ret.pb(i);
			if(i != n/i){ret.pb(n/i);}
		}
	}
	ret.pb(n);
	return ret;
}
int gcb(int a,int b){return ((b == 0)? a : gcb(b,a%b));}
int gcd(int a,int b){return (a*b) / gcb(a,b);}

int main(){
    int n;
    vecll x,y,h;
    ll ansx,ansy,ansh;
    cin >> n;
    REP(i,n){
        ll tmp1,tmp2,tmp3;
        cin >> tmp1 >> tmp2 >> tmp3;
        x.pb(tmp1); y.pb(tmp2),h.pb(tmp3);
    }
    bool ans;
    REP(cx,101){
        REP(cy,101){
            ans = true;
            ll ch = h[0] + abs(x[0]-cx) + abs(y[0]-cy);
            REP(i,n){
                if(h[i] != max(ch - abs(x[i]-cx) - abs(y[i]-cy),0)){
                    ans = false;
                    break;
                }
            }
            if(ans){
                ansx = cx; ansy = cy;ansh = ch;
                break;
            }
        }
        if(ans){
            break;
        }
    }

    cout << ansx << " " << ansy << " " << ansh << endl;
	return 0;
}



Compiler output:
a.cc: In function 'int main()':
a.cc:46:31: error: no matching function for call to 'max(ll, int)'
   46 |                 if(h[i] != max(ch - abs(x[i]-cx) - abs(y[i]-cy),0)){
      |                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:46:31: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   46 |                 if(h[i] != max(ch - abs(x[i]-cx) - abs(y[i]-cy),0)){
      |                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:46:31: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   46 |                 if(h[i] != max(ch - abs(x[i]-cx) - abs(y[i]-cy),0)){
      |                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~