Language: C++

#include <iostream>
using namespace std;
int main(){
  int n;cin>>n;
  int x[n],y[n],h[n];
  for(int i = 0; n > i; i++){
    cin>>x[i]>>y[i]>>h[i];
  }
  int ret = 0;
  for(int i = 0; 101 > i; i++){
    for(int j = 0; 101 > j; j++){
      int tmp = -1;
      
      for(int z = 0; n > z; z++){
        int nw = abs(x[z]-[i])+abs(y[z]-[i])+h[z];
        if(tmp = -1)tmp = nw;
        else if(tmp!=nw){
          tmp = -1;
          break;
        }
      }
      ret = max(ret,tmp);
    }
  }
  cout << ret << endl;
}

Compiler output:
a.cc: In lambda function:
a.cc:15:30: error: expected '{' before ')' token
   15 |         int nw = abs(x[z]-[i])+abs(y[z]-[i])+h[z];
      |                              ^
a.cc: In function 'int main()':
a.cc:15:26: error: no match for 'operator-' (operand types are 'int' and 'main()::<lambda()>')
   15 |         int nw = abs(x[z]-[i])+abs(y[z]-[i])+h[z];
      |                      ~~~~^~~~
      |                         | |
      |                         | main()::<lambda()>
      |                         int
In file included from /usr/include/c++/14/string:48,
                 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/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:1:
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:15:30: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   15 |         int nw = abs(x[z]-[i])+abs(y[z]-[i])+h[z];
      |                              ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:15:30: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   15 |         int nw = abs(x[z]-[i])+abs(y[z]-[i])+h[z];
      |                              ^
a.cc: In lambda function:
a.cc:15:44: error: expected '{' before ')' token
   15 |         int nw = abs(x[z]-[i])+abs(y[z]-[i])+h[z];
      |                                            ^
a.cc: In function 'int main()':
a.cc:15:40: error: no match for 'operator-' (operand types are 'int' and 'main()::<lambda()>')
   15 |         int nw = abs(x[z]-[i])+abs(y[z]-[i])+h[z];
      |                                    ~~~~^~~~
      |                                       | |
      |                                       | main()::<lambda()>
      |                                       int
/usr/include/c++/14/bits/stl_iterator.h:618:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__y.base() - __x.base())) std::operator-(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  618 |     operator-(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:618:5: note:   template argument deduction/substitution failed:
a.cc:15:44: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'int'
   15 |         int nw = abs(x[z]-[i])+abs(y[z]-[i])+h[z];
      |                                            ^
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr decltype ((__x.base() - __y.base())) std::operator-(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1790 |     operator-(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1790:5: note:   template argument deduction/substitution failed:
a.cc:15:44: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'int'
   15 |         int nw = abs(x[z]-[i])+abs(y[z]-[i])+h[z];
      |                                            ^