Language: C++

#include <bits/stdc++.h>
using namespace std;

int main() {
	int W,H,N;
	int x[110],b[110],a[110];
	cin >> W>> H>> N;
	int num[110][110];
	for(int i=0;i<N;i++) cin >> x[i] >> y[i] >> e[i];
	int a=0,b=w,c=0,d=h;
	for(int i0;i<N;i++){
		if(f[i]==1)a=max(a,x[i]);
		if(f[i]==2)b=min(b,x[i]);
		if(f[i]==3)c=max(c,y[i]);
		if(f[i]==4)d=min(d,y[i]);
	}
	cout <<max(0,b-a)*max(0,d-x)<<endl;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:9:45: error: 'y' was not declared in this scope
    9 |         for(int i=0;i<N;i++) cin >> x[i] >> y[i] >> e[i];
      |                                             ^
a.cc:9:53: error: 'e' was not declared in this scope
    9 |         for(int i=0;i<N;i++) cin >> x[i] >> y[i] >> e[i];
      |                                                     ^
a.cc:10:13: error: conflicting declaration 'int a'
   10 |         int a=0,b=w,c=0,d=h;
      |             ^
a.cc:6:27: note: previous declaration as 'int a [110]'
    6 |         int x[110],b[110],a[110];
      |                           ^
a.cc:10:17: error: conflicting declaration 'int b'
   10 |         int a=0,b=w,c=0,d=h;
      |                 ^
a.cc:6:20: note: previous declaration as 'int b [110]'
    6 |         int x[110],b[110],a[110];
      |                    ^
a.cc:10:19: error: 'w' was not declared in this scope
   10 |         int a=0,b=w,c=0,d=h;
      |                   ^
a.cc:11:20: error: 'i' was not declared in this scope; did you mean 'i0'?
   11 |         for(int i0;i<N;i++){
      |                    ^
      |                    i0
a.cc:12:20: error: 'f' was not declared in this scope
   12 |                 if(f[i]==1)a=max(a,x[i]);
      |                    ^
a.cc:13:20: error: 'f' was not declared in this scope
   13 |                 if(f[i]==2)b=min(b,x[i]);
      |                    ^
a.cc:14:20: error: 'f' was not declared in this scope
   14 |                 if(f[i]==3)c=max(c,y[i]);
      |                    ^
a.cc:14:28: error: 'c' was not declared in this scope
   14 |                 if(f[i]==3)c=max(c,y[i]);
      |                            ^
a.cc:14:36: error: 'y' was not declared in this scope
   14 |                 if(f[i]==3)c=max(c,y[i]);
      |                                    ^
a.cc:15:20: error: 'f' was not declared in this scope
   15 |                 if(f[i]==4)d=min(d,y[i]);
      |                    ^
a.cc:15:28: error: 'd' was not declared in this scope
   15 |                 if(f[i]==4)d=min(d,y[i]);
      |                            ^
a.cc:15:36: error: 'y' was not declared in this scope
   15 |                 if(f[i]==4)d=min(d,y[i]);
      |                                    ^
a.cc:17:19: error: no matching function for call to 'max(int, long int)'
   17 |         cout <<max(0,b-a)*max(0,d-x)<<endl;
      |                ~~~^~~~~~~
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:17:19: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long int')
   17 |         cout <<max(0,b-a)*max(0,d-x)<<endl;
      |                ~~~^~~~~~~
/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:17:19: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   17 |         cout <<max(0,b-a)*max(0,d-x)<<endl;
      |                ~~~^~~~~~~
a.cc:17:33: error: 'd' was not declared in this scope
   17 |         cout <<max(0,b-a)*max(0,d-x)<<endl;
      |                                 ^