Zombie Land 2
시간 제한2초메모리 제한1024 MB
움직이는 사람이 거리 D 이내의 다른 사람을 감염시키는 상황에서 모든 사람이 감염되는 최초 시각을 가중 최단 경로로 구한다.
문제
As you know, your friend Tatsumi is a producer of Immortal Culture Production in Chiba (ICPC). He once planned to form a zombie rock band named Gray Faces and cheer Chiba Prefecture up, and still plans to do so.
But unfortunately, once again, there is only one zombie in ICPC. So Tatsumi decided to release the zombie into the city of Chiba after enhancing the zombie's infectious power, to produce a sufficient number of zombies. The infectious zombie changes a human into a new infectious zombie when the distance between the human and the zombie is less than or equal to . Note that a zombie that was a human also changes a human into a zombie.
The city of Chiba is represented by an infinitely large two-dimensional plane, and Tatsumi will release the zombie at a point with a coordinate . After the release, the zombie will start walking at a speed of per second. There are also humans on the two-dimensional plane. When Tatsumi releases the zombie, the -th human will be at a point with a coordinate and will start walking at a speed of per second. Humans will not change their walking direction or speed when they become zombies.
For each human, Tatsumi wants to know when the human becomes a zombie. Please help him by writing a program that calculates a time when each human becomes a zombie.
입력
The input consists of a single test case of the following format.
The first line contains two integers and (, ) separated by a space, which represent the number of humans and the distance to be infected. The following line contains four integers and () separated by a space, which represent the initial position and direction of the zombie. Each of the next lines contains four integers , , and () separated by a space, which represent the initial position and direction of the -th human.
출력
The output consists of lines. In the -th line, print the time when the -th human becomes a zombie. If the -th human will never become a zombie, print instead. The answer will be considered as correct if the values output have an absolute or relative error less than .