|
|||
Fly
There is a market in the capital city. Three carts () simultaneously start heading toward the market (). The carts travel along straight paths toward the market at speeds , respectively. At the moment of departure, a fly located at point starts flying along a straight line at speed , visiting the carts in the sequence , continuing this pattern as long as all carts remain farther than a distance from the market. We can assume that as soon as the fly reaches a cart, it immediately starts flying toward the next cart in the sequence without any delay. Péter’s task is to calculate the total distance flown by the fly. Unfortunately, Péter is not very good at physics and has no idea where to start—let’s help him. The carts, the market, and the fly are considered points on a plane, with coordinates measured in kilometers.Input specificationThe first three lines each contain three numbers: . The fourth line contains the coordinates of the market, , and the distance . The fifth line contains the starting position and speed of the fly, and . The numbers on each line are separated by spaces. All values are integers. Output specificationThe distance flown by the fly, rounded to 2 decimal places. Constraints
Sample input 1
Sample output 1
Sample input 2
Sample output 2
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |