
ZOJ Problem Set  3409
KKV (short for Kinetic Kill Vehicle), a new kind of projectile, is a powerful weapon and has a great ability to move in the space. PLA developed a new missile based on the technology of KKV, and this kind of missile can launch and fly in the space, find the target and destroy it. Now the launch site of the KKV missile is at position (0, 0, 0), the missile will fly through N polygonal lines in order and its initial speed is zero. The initial mass of the missile is M, the mass without fuel is m, and every time the missile can eject some fuel which always has a mass of m_{0}, and the eject speed (scalar) is always v_{0} (absolute, not relative). Now give you the N points in order which are the endpoints of the N polygonal lines(The first line is from (0, 0, 0) to the first point, the second line is from the first point to the second point, the third line is from the second point to the third point, etc.), your task is to calculate the time between the KKV missile's launching and its arriving at the N_{th} point. The KKV missile is so small that its size can be ignored. It can only and have to eject fuel at all the endpoints except the N_{th} point, and every time if it ejects fuel, the KKV missile always selects the direction that can make it fly along the next line, and have the largest speed. The motion of the KKV missile obey the principle of momentum conservation, thus m_{1} × v_{1} + m_{2} × v_{2} = m_{1} × v'_{1} + m_{2} × v'_{2}, here m_{1} and m_{2} are the mass of two objects, v_{1} and v'_{1} are the original speed and the speed after collision of m_{1}, v_{2} and v'_{2} are the original speed and the speed after collision of m_{2}. But you know that sometimes the PLA will hide some real abilities about their weapons, so sometimes the data might not be valid to this kind of KKV. So, if you find this thing happens, just output "Another kind of KKV.". InputThere are multiply test cases. Each case begins with a line contains 5 integers N M m m_{0} and v_{0}, here 1 ≤ N ≤ 40, 1 ≤ m < M  N × m_{0}, M ≤ 200000, 1 ≤ m_{0}, 1 ≤ v_{0} ≤ 100. Then the following N lines each contains three integers x_{i} y_{i} and z_{i}(1 ≤ i ≤ N), indicate the i_{th} point's coordinates. Here 100000 ≤ x_{i}, y_{i}, z_{i} ≤ 100000, and we guarantee that every pair of consecutive lines won't be perpendicular to each other, and the next line won't be in the negative direction of its previous one. (This means three consecutive points cannot be { (0, 0, 0), (0, 0, 3), (1, 1, 2) } or { (0, 0, 0), (0, 0, 3), (1, 1, 3) }, or something like these) OutputFor each test case, output the total flying time of the KKV missile in one line, with two digits after the decimal point, if the data cannot satisfy the KKV missile's flying path, output "Another kind of KKV." instead. If the relative error is no more than 1e6, the answer will be accepted. Sample Input2 10 1 2 5 2 2 2 4 4 4 2 10 2 2 2 0 0 3 2 2 5 4 10 1 2 20 0 0 40 0 0 80 10 10 110 10 20 115 Sample Output3.81 10.50 Another kind of KKV. Author: FAN, Yuzhe Contest: ZOJ Monthly, October 2010 