Iraq War
Time Limit: 1 Second Memory Limit: 32768 KB
In the Iraq war, one type of jeep called Hanma is used frequently by American. Now, you are a soldier of U.S army, and your commander asks you to send an important message to a base D in the center of desert from base S,which is your position now using your Hanma jeep.
Your jeep can load at most C kg diesel oil, and consumes U kg diesel oil per km. Among the desert, there are N service stations, but they are destroyed in the war. So you can't get anything in the station, but you can deposit your oil for future use or retake it. You can get diesel oil only in base S. As we know, U.S attacks Iraq for oil, so you should get as little oil as possible from station S. Now your first task is to make sure whether this mission is possible,which means if you can drive from base S to base D, if yes calculate how much oil is needed at least.
Input
There are many test cases. For each test case, the first line contains two real number C and U. The second line contain three integer N(<=100), S(0<=S<N), D(0<=D<N) which denotes thetotle number of service stations and bases, the next Sth line is the coordinate of base s and the next Dth line is the the coordinate of base D.
Then N line follow. Each line contains two real number x, y which is the coordinate of base or service station and denotes that the base or service station is x km to the original point in horizontal and y km to the the original point in vertical.
C==0 and U==0 denotes the end of input.
Output
For each testcase, if the mission is impossible, output "unreachable", else output the minimal amount of oil you need, accurate to 4 decimal num.
Sample Input
5.66 1 8 3 0 0 0 0 4 4 0 4 4 1 2 2 1 3 2 2 3 1 1 8 3 0 0 0 0 4 4 0 4 4 1 2 2 1 3 2 2 3 0 0
Sample Output
5.6569 unreachableSubmit
Source: ZOJ Monthly, February 2005