Language: C++

#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<ll>;
using vll = vector<vector<ll>>;
using pii = pair<int,int>;
#define FOR(i,a,b) for(ll i = (a); i < (b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
const double pi = acos(-1);
const double EPS = 1e-10;
#define int ll


struct dat {
  int x,y,h;
  bool operator<(const dat& right) const{
    return h < right.h;
  } 
};

signed main(){
  int n;
  cin >> n;
  vector<dat> a(n);
  int h = 0;
  bool flag = false;
  REP(i,n)cin >> a[i].x >> a[i].y >> a[i].h;
  sort(ALL(a));
  reverse(ALL(a));
  int i,j;
  for(i = 0; i < 101; i++){
    for(j = 0;j < 101; j++){
      h = abs(a[k].x-i) + abs(a[k].y-j) + a[k].h;
      REP(k,n){
        if (a[k].h == max(h-abs(a[k].x-i)-abs(a[k].y-j),0)) {
          flag = true;
          break;
        }
      }
      if (flag) {
        break;
      }
      h = 0;
    }
    if (flag) {
      break;
    }
  }
  cout << i << " " << j << " " << h << endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:38:17: error: 'k' was not declared in this scope
   38 |       h = abs(a[k].x-i) + abs(a[k].y-j) + a[k].h;
      |                 ^
a.cc:40:26: error: no matching function for call to 'max(ll, int)'
   40 |         if (a[k].h == max(h-abs(a[k].x-i)-abs(a[k].y-j),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:40:26: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   40 |         if (a[k].h == max(h-abs(a[k].x-i)-abs(a[k].y-j),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:40:26: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   40 |         if (a[k].h == max(h-abs(a[k].x-i)-abs(a[k].y-j),0)) {
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~