#include <bits/stdc++.h>

using namespace std;
const int N = 25;
int a[N][N][N];

int main() {
    int w, x, h, q;
    cin >> w >> x >> h >> q;

    int x1, y1, z1, x2, y2, z2, ans = 0;
    while (q--) {
        cin >> x1 >> y1 >> z1 >> x2 >> y2 >> z2;
        for (int i = x1; i <= x2; i++)
            for (int j = y1; j <= y2; j++)
                for (int k = z1; k <= z2; k++)
                    a[i][j][k] = 1;//逆向思维
    }
    //计算剩余块数量
    for (int i = 1; i <= w; ++i)
        for (int j = 1; j <= x; ++j)
            for (int k = 1; k <= h; ++k)
                if (!a[i][j][k])ans++;
    cout << ans << endl;
    return 0;
}

相关文章:

  • 2021-12-06
  • 2021-11-05
  • 2021-07-03
  • 2021-09-04
  • 2021-07-31
  • 2022-01-15
猜你喜欢
  • 2022-01-09
  • 2022-12-23
  • 2021-07-13
  • 2021-09-17
  • 2022-02-08
  • 2021-04-23
  • 2021-08-01
相关资源
相似解决方案