Language: C++

//#include <bits/stdc++.h>
#include <algorithm>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define loop(i, x, n) for (int i = (x); i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define int long long
using namespace std;
const int MOD = 1e9 + 7;
const int INF = 1e10;
template<typename T> void cmax(T &a, T b) { a = max(a, b); }
template<typename T> void cmin(T &a, T b) { a = min(a, b); }

signed main() {
  int n;
  cin >> n;
  vector<int> x(n), y(n), h(n);
  rep(i, n) cin >> x[i] >> y[i] >> h[i];

  rep(cx, 101) {
    rep(cy, 101) {
      set<int> H;
      rep(i, n) {
        if (h[i] != 0) {
          int tmp = h[i] + abs(x[i] - cx) + abs(y[i] - cy);
          H.insert(tmp);
        }
      }
      // cout << H.size() << endl;
      if (H.size() == 1) {
        bool flag = true;
        rep(i, n) if (h[i] != max(*H.begin() - abs(x[i] - cx) - abs(y[i] - cy), 0)) flag = false;
        if (falg) {
          cout << cx << ' ' << cy << ' ' << *H.begin() << endl;
          return 0;
        }
      }
    }
  }

  return 0;
}


Compiler output:
a.cc: In function 'int main()':
a.cc:40:34: error: no matching function for call to 'max(long long int, int)'
   40 |         rep(i, n) if (h[i] != max(*H.begin() - abs(x[i] - cx) - abs(y[i] - cy), 0)) flag = false;
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/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:34: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   40 |         rep(i, n) if (h[i] != max(*H.begin() - abs(x[i] - cx) - abs(y[i] - cy), 0)) flag = false;
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:34: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   40 |         rep(i, n) if (h[i] != max(*H.begin() - abs(x[i] - cx) - abs(y[i] - cy), 0)) flag = false;
      |                               ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:41:13: error: 'falg' was not declared in this scope; did you mean 'flag'?
   41 |         if (falg) {
      |             ^~~~
      |             flag