Language: C++

#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_map>
#include<fstream>
#include<list>
#include<typeinfo>
#include<functional>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;

vector<pair<ll,pll>> V;

ll judge(ll x,ll y){
    ll h=V[0].F+abs(x-V[0].S.F)+abs(y-V[0].S.S);
    if(h<=0){return -1;}
    for(int i=1;i<V.size();i++){
        ll H=h-abs(x-V[i].S.F)-abs(y-V[i].S.S);
        H=max(H,0);
        if(H!=V[i].F){return -1;}
    }
    return h;
}

    
int main(){
    ll n;
    cin>>n;
    V.resize(n);
    for(int i=0;i<n;i++){
        ll x,y,h;
        cin>>x>>y>>h;
        V[i]={h,{x,y}};
    }
    sort(V.begin(),V.end(),greater<pair<ll,pll>>());
    if(V[0].F==0){
        while(1);
    }
    for(int i=0;i<=100;i++){
        for(int t=0;t<=100;t++){
            ll ret=judge(i,t);
            if(ret!=-1){
                cout<<i<<" "<<t<<" "<<ret<<endl;
                return 0;
            }
        }
    }
    assert(false);
    
    
    
    return 0;
}


Compiler output:
a.cc: In function 'll judge(ll, ll)':
a.cc:42:14: error: no matching function for call to 'max(ll&, int)'
   42 |         H=max(H,0);
      |           ~~~^~~~~
In file included from /usr/include/c++/14/string:51,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/iomanip:42,
                 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:42:14: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   42 |         H=max(H,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,
                 from a.cc:7:
/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:42:14: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   42 |         H=max(H,0);
      |           ~~~^~~~~