#P11372. 「CZOI-R2」加训
「CZOI-R2」加训
Problem Description
_O_v_O_ has arrived in a -dimensional world.
The computer lab can be viewed as a -dimensional cube of size (you can think of it as a -dimensional coordinate system), where the coordinate on each dimension ranges from to .
There are OIers. The -th one is at . Unfortunately, all OIers are slacking off.
There are also obstacles in the lab. The -th obstacle is at .
In addition, there are coaches. The -th coach is at .
A coach does not want to see OIers slacking off. As long as a coach and some OIer have exactly coordinates (dimensions) that are the same, and the line segment connecting them contains no other obstacle, OIer, or coach, then that OIer is caught slacking off.
For each coach, ask how many OIers they can catch slacking off.
Input Format
The first line contains two integers , representing the side length of the cube and the number of dimensions.
The second line contains three integers , representing the numbers of OIers, obstacles, and coaches.
Next come lines, each containing numbers. Line gives the position of the -th OIer.
Next come lines, each containing numbers. Line gives the position of the -th obstacle.
Next come lines, each containing numbers. Line gives the position of the -th coach.
Output Format
Output one line with integers, where the -th integer is the number of OIers seen by the -th coach.
10 2
2 2 2
1 1
1 2
2 1
2 3
3 1
3 2
0 1
Hint
[Sample Explanation]
Pairs of an OIer and a coach that satisfy having equal coordinates are: OIer 1 with coach 1, and OIer 2 with coach 2. However, there is an obstacle between OIer 1 and coach 1, so the OIer will not be caught.
[Constraints]
This problem uses bundled testdata.
- Subtask #1 (): .
- Subtask #2 (): .
- Subtask #3 (): .
For of the testdata, , , , , . It is guaranteed that no OIer, coach, or obstacle shares the same position.
Translated by ChatGPT 5