#include<bits/stdc++.h>
using namespace std;
int main(){
int w, x, h, x1, y1, z1, x2, y2, z2, q, ls[20][20][20] = {}, count = 0;
cin >> w >> x >> h >> q;
for(int i = 0; i < q; ++i){
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){
ls[i][j][k] = 1;
}
}
}
}
for(int i = 0; i < w; ++i){
for(int j = 0; j < x; ++j){
for(int k = 0; k < h; ++k){
if(ls[i + 1][j + 1][k + 1] == 0) count++;
}
}
}
cout << count;
return 0;
}
错误的样例是:
//输入
20 11 17
29
5 2 6 19 11 7
1 5 10 5 7 17
11 1 7 14 3 17
6 10 11 13 11 12
12 2 5 14 3 7
5 5 4 7 6 13
3 2 15 17 6 16
12 4 3 17 11 13
14 9 4 19 10 6
11 3 2 19 10 7
4 1 7 9 1 14
4 4 9 14 8 12
14 4 2 18 10 13
11 7 8 19 11 16
4 8 16 4 9 17
4 5 8 9 8 10
5 3 9 6 3 10
8 5 6 14 6 12
13 7 7 16 7 17
5 7 9 16 11 17
4 11 4 13 11 5
5 10 5 19 11 13
6 2 7 9 8 17
1 4 6 10 11 15
10 6 1 18 10 12
2 8 5 16 11 12
8 4 13 9 9 16
7 6 3 15 8 14
15 4 14 19 8 17
输出:
1210