Language: C++

#include <bits/stdc++.h>

using namespace std;
using ll =long long;
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
#define leftunique(a) {sort((a).begin(),(a).end());(a).erase(unique((a).begin(),(a).end()),(a).end());}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
static const ll INF = 1LL << 60;
//Write From this Line

int main()
{
	ll n;
	cin >> n;
	vector<ll> x(n), y(n), h(n);
	rep(i,n) cin >> x[i] >> y[i] >> h[i];
	// 全探索
	ll H;
	for(ll Cx = 0; Cx <= 100; Cx++) {
		for(ll Cy = 0; Cy <= 100; Cy++) {
			// x0, y0, h0 からHを求め，他のやつでも成り立てばok?
			H = h[0] + abs(x[0] - Cx) + abs(y[0] - Cy);
			// ここで，Hが1以上じゃなかったらどうすりゃいいんだ…
			if(H < 1) {
				continue;
			}
			bool flag = true;
			For(i,1,n) {
				if(h[i] == max((ll)H-abs(x[i] - Cx) - abs(y[i] -Cy), 0)){
					// ok
				} else {
					// dame
					flag = false;
					break;
				}
			}
			if(flag){
				prllf("%d %d %d\n",Cx, Cy, H);
			}
		}
	}
}


Compiler output:
a.cc: In function 'int main()':
a.cc:32:47: error: no matching function for call to 'max(ll, int)'
   32 |                                 if(h[i] == max((ll)H-abs(x[i] - Cx) - abs(y[i] -Cy), 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:32:47: note:   deduced conflicting types for parameter 'const _Tp' ('long long int' and 'int')
   32 |                                 if(h[i] == max((ll)H-abs(x[i] - Cx) - abs(y[i] -Cy), 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:32:47: note:   mismatched types 'std::initializer_list<_Tp>' and 'long long int'
   32 |                                 if(h[i] == max((ll)H-abs(x[i] - Cx) - abs(y[i] -Cy), 0)){
      |                                            ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
a.cc:41:33: error: 'prllf' was not declared in this scope
   41 |                                 prllf("%d %d %d\n",Cx, Cy, H);
      |                                 ^~~~~