All-terrain vehicle
The all-terrain vehicle needs to travel from the starting point S to the finish point F across the steppe, which includes a desert area. The desert is a wedge-shaped region on the plane, defined by two rays originating from the origin. One ray points upwards along the OY axis, while the other is in the 1st quadrant, forming an angle φ with the first ray. The vehicle can traverse the desert at a speed of V_1 and the steppe at a speed of V_0, where V_0 is greater than or equal to V_1. Determine the minimum time t required for the vehicle to travel from point S to point F.
The input consists of a single line with 7 real numbers: X_S, Y_S, X_F, Y_F, φ, V_0, V_1. These represent the coordinates of point S(X_S, Y_S), the coordinates of point F(X_F, Y_F), the angle at the vertex of the wedge (in radians), and the vehicle's speeds across the steppe and through the desert. The output should be a single real number — the minimum time t required, accurate to three decimal places.
Constraints are as follows: –1000 < X_S < 0 < X_F < 1000; –1000 < Y_S, Y_F < 1000; both points S and F are outside the desert and not on its boundary; the line segment SF intersects the desert;
pi/180 < φ < pi/4; V_1 ≤ V_0 ≤ 4V_1; 0.1 ≤ V_1 ≤ 5.