Swimming
Time limit1sMemory limit1024 MB
Given Ostap's start, Skumbriewitz's buoy, and Berlaga's position, find the length of a logarithmic spiral path around Berlaga that keeps a constant angle to the line of sight.
Problem
Trying to reach Skumbriewitz, who was floundering around the buoy, Ostap Bender swam on his side, keeping an eye on Berlaga, who was sitting on the shore. Ostap's head was turned by a constant angle for the whole time. For that reason he swam along a curve rather than along a straight line, so the angle between the direction of his swimming and the direction to Berlaga was constant.
Your task is to find the length of Ostap Bender's trajectory.
Input
The input consists of three lines. Each line contains two integers with absolute value not exceeding . The first line contains the initial coordinates of Ostap Bender, the second line contains the coordinates of his destination, Skumbriewitz, and the third line contains the coordinates of Berlaga. All given points are pairwise distinct. Berlaga and Skumbriewitz do not move while Ostap is swimming.
Output
Print a single real number: the length of the shortest trajectory from Ostap's initial position to Skumbriewitz's buoy, given that the angle between the tangent to the trajectory and the direction to Berlaga is constant. Your answer must have a relative or absolute error not greater than .