#K571. Perfectly Fitting Boxes
Perfectly Fitting Boxes
Perfectly Fitting Boxes
You are given several test cases. In each test case, you are provided with the dimensions of an outer box and a list of inner boxes. Each box is described by three integers representing its length, width, and height.
An inner box is said to fit perfectly into the outer box if and only if all its dimensions are exactly equal to the corresponding dimensions of the outer box. Mathematically, if the outer box has dimensions \(L, W, H\) and an inner box has dimensions \(l_i, w_i, h_i\), then the box fits perfectly if:
\(l_i = L,\; w_i = W,\; h_i = H\)
Your task is to determine, for each test case, how many inner boxes fit perfectly into the outer box.
inputFormat
The input is read from stdin and has the following format:
- The first line contains an integer \(T\) representing the number of test cases.
- For each test case, the first line contains three integers \(L\; W\; H\) representing the dimensions of the outer box.
- The next line contains an integer \(N\) indicating the number of inner boxes.
- The following \(N\) lines each contain three integers \(l_i\; w_i\; h_i\) representing the dimensions of an inner box.
All numbers are separated by spaces, and each test case appears consecutively.
outputFormat
For each test case, output a single integer on a separate line representing the count of inner boxes that fit perfectly into the outer box. The output should be printed to stdout.
## sample1
10 8 6
3
5 7 2
9 7 5
10 8 6
1
</p>