Language: C++

#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
    int W, H, N;

    cin >> W >> H >> N;

    vector<int> x(N), y(N), a(N);
    for (int i = 0; i < N; i++) {
        cin >> x.at(i) >> y.at(i) >> a.at(i);
    }

    int A[W][H] = {W, H};
    int B[W][H] = {0, 0};

    for (int i = 0; i < N; i++) {
        switch (a.at(i)) {
            case 1:
                if (B.at(0) > x.at(i)) {
                    B.at(0) = x.at(i);
                }
            case 2:
                if (A.at(0) < x.at(i)) {
                    A.at(0) = x.at(i);
                }
            case 3:
                if (B.at(1) < y.at(i)) {
                    B.at(1) = y.at(i);
                }
            case 4:
                if (A.at(1) > y.at(i)) {
                    A.at(1) = y.at(i);
                }
        }
    }

    if ((A.at(0) - B.at(0) > 0) && (A.at(1) - B.at(0) > 0)) {
        cout << (A.at(0) - B.at(0)) * (A.at(1) - B.at(0)) << endl;
    }

    return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:23:23: error: request for member 'at' in 'B', which is of non-class type 'int [W][H]'
   23 |                 if (B.at(0) > x.at(i)) {
      |                       ^~
a.cc:24:23: error: request for member 'at' in 'B', which is of non-class type 'int [W][H]'
   24 |                     B.at(0) = x.at(i);
      |                       ^~
a.cc:27:23: error: request for member 'at' in 'A', which is of non-class type 'int [W][H]'
   27 |                 if (A.at(0) < x.at(i)) {
      |                       ^~
a.cc:28:23: error: request for member 'at' in 'A', which is of non-class type 'int [W][H]'
   28 |                     A.at(0) = x.at(i);
      |                       ^~
a.cc:31:23: error: request for member 'at' in 'B', which is of non-class type 'int [W][H]'
   31 |                 if (B.at(1) < y.at(i)) {
      |                       ^~
a.cc:32:23: error: request for member 'at' in 'B', which is of non-class type 'int [W][H]'
   32 |                     B.at(1) = y.at(i);
      |                       ^~
a.cc:35:23: error: request for member 'at' in 'A', which is of non-class type 'int [W][H]'
   35 |                 if (A.at(1) > y.at(i)) {
      |                       ^~
a.cc:36:23: error: request for member 'at' in 'A', which is of non-class type 'int [W][H]'
   36 |                     A.at(1) = y.at(i);
      |                       ^~
a.cc:41:12: error: request for member 'at' in 'A', which is of non-class type 'int [W][H]'
   41 |     if ((A.at(0) - B.at(0) > 0) && (A.at(1) - B.at(0) > 0)) {
      |            ^~
a.cc:41:22: error: request for member 'at' in 'B', which is of non-class type 'int [W][H]'
   41 |     if ((A.at(0) - B.at(0) > 0) && (A.at(1) - B.at(0) > 0)) {
      |                      ^~
a.cc:41:39: error: request for member 'at' in 'A', which is of non-class type 'int [W][H]'
   41 |     if ((A.at(0) - B.at(0) > 0) && (A.at(1) - B.at(0) > 0)) {
      |                                       ^~
a.cc:41:49: error: request for member 'at' in 'B', which is of non-class type 'int [W][H]'
   41 |     if ((A.at(0) - B.at(0) > 0) && (A.at(1) - B.at(0) > 0)) {
      |                                                 ^~
a.cc:42:20: error: request for member 'at' in 'A', which is of non-class type 'int [W][H]'
   42 |         cout << (A.at(0) - B.at(0)) * (A.at(1) - B.at(0)) << endl;
      |                    ^~
a.cc:42:30: error: request for member 'at' in 'B', which is of non-class type 'int [W][H]'
   42 |         cout << (A.at(0) - B.at(0)) * (A.at(1) - B.at(0)) << endl;
      |                              ^~
a.cc:42:42: error: request for member 'at' in 'A', which is of non-class type 'int [W][H]'
   42 |         cout << (A.at(0) - B.at(0)) * (A.at(1) - B.at(0)) << endl;
      |                                          ^~
a.cc:42:52: error: request for member 'at' in 'B', which is of non-class type 'int [W][H]'
   42 |         cout << (A.at(0) - B.at(0)) * (A.at(1) - B.at(0)) << endl;
      |                                                    ^~