#P5696. [CTSC1998] 监视摄像机
[CTSC1998] 监视摄像机
Description
Our task is to determine the camera position so that every corner of the room can be monitored by it.
For example, Figure 1 and Figure 2 are sketches of two rooms. Each room is represented by a closed polygon.

Each edge in the figure represents a wall.
For the room in Figure 1, placing the camera at the black point meets the requirement.
For the room in Figure 2, no matter where the camera is placed, the requirement cannot be met.
Write a program that, given a room sketch, determines whether it is possible to place one camera somewhere inside the room so that it can monitor any corner of the room.
Input Format
The input contains one or more room descriptions.
The first line of each description is a positive integer , indicating that the room sketch is an -gon.
The next lines each contain two integers separated by spaces, which are the coordinates of the vertices of the polygon in the Cartesian coordinate system, listed in clockwise order.
indicates the end of input.
Output Format
For each room, first output one line with the room index in the format Room #k:, where starts from in the input order.
The next line is the result. If placing a camera somewhere in the room can satisfy the condition, output Surveillance is possible.; otherwise output Surveillance is impossible.
Print a blank line between the outputs of every two rooms.
4
0 0
0 1
1 1
1 0
8
0 0
3 0
4 3
2 2
3 4
4 4
4 5
0 5
0
Room #1:
Surveillance is possible.
Room #2:
Surveillance is impossible.
Hint
Constraints
,。
Translated by ChatGPT 5
京公网安备 11011102002149号