The car with the Wi-Fi radar is driving along the streets. It collects information about the accessible Wi-Fi hotspots in some definite places by determining MAC-address and azimuth angle to the hotspot. Also, the city map is available. It provides the list of buildings and coordinates of polygons vertices that form their outlines.
Your task is to determine in which buildings hotspots are located.
The first argument is a path to a file that contains the city map and the Wi-Fi radar log. The city map is separated from the Wi-Fi radar log by an empty line.
The city map is represented as a list of buildings, one building per line. Each line of city map data starts with a building name and is followed by coordinates of vertices that form its outline. Coordinates are pairs X and Y separated by semicolon ‘;’. Coordinates are separated by space.
Each line of the Wi-Fi radar log starts with coordinates X and Y separated by semicolon ‘;’ of radar’s current position. If any hotspot was detected radar coordinates are followed by its MAC-address and azimuth angle (in degrees) separated by semicolon ‘;’.
B001 14.88;8.94 14.88;33.23 25.29;33.23 25.29;15.88 32.23;15.88 32.23;8.94 14.88;8.94 B002 14.88;33.23 14.88;43.64 49.58;43.64 49.58;26.29 39.17;26.29 39.17;33.23 14.88;33.23 ... some lines skipped ... B010 63.45;50.58 70.39;50.58 70.39;43.64 63.45;43.64 63.45;50.58 56.51;5.47 56-4c-18-eb-13-8b;59.3493 88-fe-14-a4-aa-2a;303.0239 42.64;5.47 88-fe-14-a4-aa-2a;0.0000 28.76;5.47 88-fe-14-a4-aa-2a;56.9761 14.88;5.47 88-fe-14-a4-aa-2a;71.9958 11.41;15.88 11.41;29.76 ... some lines skipped ... 56.51;64.45 f9-aa-de-15-28-46;277.5946 de-c2-8e-34-08-17;214.6952
Print to stdout names of buildings which have Wi-Fi hotspots. The order should be alphabetical.
B003 B005 B007
- 0° azimuth direction is the same as +Y axis direction
- Hotspots can be located both inside and outside of the building
- There can be more than one hotspot in the building
- Hotspots are immovable during all measurements