Language: C++

// https://atcoder.jp/contests/abc112/tasks/abc112_c
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
using namespace std;

#define FOR(i, n) for (int i = 0; i < n; i++)
#define EACH(i, n) for (auto &i: n)

int64_t check(vector<int64_t> x, vector<int64_t> y, vector<int64_t> h, int64_t cx, int64_t cy) {
  int64_t hh =  h[0] + abs(x[0] - cx) + abs(y[0] - cy);
  for (int i = 1; i < h.size(); i++) {
    int64_t t = max(hh - abs(x[i] - cx) - abs(y[i] - cy), 0LL);
    if (t != h[i]) {
      return -1;
    }
  }
  return hh;
}

void solv(int n) {
  vector<int64_t> x(n), y(n), h(n);

  FOR(i, n) {
    cin >> x[i] >> y[i] >> h[i];
  }
  FOR(cx, 101) {
    FOR(cy, 101) {
      int64_t ans = check(x, y, h, cx, cy);
      if (ans != -1) {
        cout << cx << " " << cy << " " << ans << endl;
        return;
      }
    }
  }
}

int main() {
  int n;

  while (cin >> n) {
    solv(n);
  }

  return 0;
}


Compiler output:
a.cc: In function 'int64_t check(std::vector<long int>, std::vector<long int>, std::vector<long int>, int64_t, int64_t)':
a.cc:16:20: error: no matching function for call to 'max(int64_t, long long int)'
   16 |     int64_t t = max(hh - abs(x[i] - cx) - abs(y[i] - cy), 0LL);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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:16:20: note:   deduced conflicting types for parameter 'const _Tp' ('long int' and 'long long int')
   16 |     int64_t t = max(hh - abs(x[i] - cx) - abs(y[i] - cy), 0LL);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/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:16:20: note:   mismatched types 'std::initializer_list<_Tp>' and 'long int'
   16 |     int64_t t = max(hh - abs(x[i] - cx) - abs(y[i] - cy), 0LL);
      |                 ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~