Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}

int main(){
    ll N;
    cin >> N;
    vector<ll> x(N),y(N),h(N);
    rep(i,N){
        cin >> x[i] >> y[i] >> h[i];    
    }

    bool flag = true;
    rep(a,101){
        rep(b,101){
            ll L = 0;
            ll R = 1e18;
            while(L+1 < R){
                ll X = (L+R)/2;
                ll flag = -1;
                rep(i,N){
                    if(max(X - abs(x[i]-a) - abs(y[i]-b),0) < h[i]){
                        flag = 1;
                        break;
                    }else if(max(X - abs(x[i]-a) - abs(y[i]-b),0) > h[i]){
                        flag = 0;
                        break;
                    }
                }
                if(flag == -1){
                    cout << a << " " << b << " " << X << endl;
                    return 0;
                }else if(flag == 1){
                    L = X;
                }else{
                    R = X;
                }
            }
        }
    }
    //cout << cnt << endl;
}

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