In the event of technical difficulties with Szkopuł, please contact us via email at [email protected].
If you would like to talk about tasks, solutions or technical problems, please visit our Discord servers. They are moderated by the community, but members of the support team are also active there.
Breaking news from Bytetown: the palaeontologists have discovered fossil remains of dinosaurs near the city! After hearing the news, several citizens of Bytetown wanted to pick up a bone or two for themselves. To save the priceless remains of dinosaurs, the mayor of Bytetown has decided to protect the excavation area and hired army for this purpose.
General Byteasar has located soldiers in several strategic positions of the excavation area. We say that a point of the area is protected if moving from that point in any direction one unavoidably reduces the distance to at least one of the soldiers.
Byteasar has just been assigned a new rookie soldier. The general has decided to place the soldier in one of the remaining vacant strategic positions. For each of the possible placements he would like to know what is the total area of the protected part of the excavations.
The first line of input contains two integers and (, ): the number of soldiers that are already stationed in the excavation area and the number of vacant strategic positions. The following lines provide a description of the soldier's positions. The -th of those lines contains two integers () that represent the coordinates of the position occupied by the -th soldier (in a rectangular coordinate system). The following lines provide a description (in the same format) of the vacant strategic positions. All the points listed in the input are distinct.
You may assume that the area of the part of the excavations protected by the soldiers is positive.
Your program should output exactly lines. The -th line should contain the total area of the protected part of the excavations after the rookie soldier is located in the -th previously vacant strategic position. All numbers should be written with a single digit after the decimal dot.
For the input data:
3 2 0 0 2 -1 1 2 3 1 1 0
the correct result is:
5.0 2.5
Task author: Tomasz Idziaszek.