Problem M
Treasure Spotting
For Timmy’s birthday his parents threw him a pirate themed party! A treasure is buried in the yard and now it is up to Timmy and his pirate crew to find it. Help the pirates find the treasure by letting them know who can see where the treasure is buried.
To make the game interesting, there are walls placed in the yard to obscure vision. Each pirate has a field of view that determines what they can see. Each pirate can see a certain distance away and can only see in a semi-circle based on the direction they are looking (see image below). A point cannot be seen in a pirate’s field of view if either another pirate or some part of a wall is directly between the point that is being looked at and the pirate that is looking. Each pirate is a single point, and each wall is an infinitely thin line.
Which pirates can see where the treasure is buried?
![\includegraphics[width=0.7\textwidth ]{sample.pdf}](/problems/treasurespotting/file/statement/en/img-0001.png)
Input
The first line of input contains two integers
The second line contains the coordinates of the treasure.
The next
The next
All coordinates are an
Output
Display
Sample Input 1 | Sample Output 1 |
---|---|
2 3 2 3 1 2 2 0 0 0 3 1 0 1 3 4 5 0 5 5 2 6 2 5 |
not visible visible not visible |
Sample Input 2 | Sample Output 2 |
---|---|
0 3 0 0 1 0 1 1 3 0 -4 0 -2 0 -5 0 |
visible not visible not visible |