Swimming

시간 제한1초메모리 제한1024 MB

요약
세 점이 주어질 때, 수영 방향과 고정된 점을 향하는 방향 사이의 각이 일정하게 유지되는 추적 곡선의 길이를 구한다.
난이도

보통10점 중 7점

유형
기하, 수학, 구현
정답자
아직 제출이 없습니다

문제

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.

입력

The input file consists of three lines. Each of these lines contains two integers not exceeding 10510^5 by absolute value. The first line contains the initial coordinates of Ostap Bender, the second line contains the coordinates of his destination -- Skumbriewitz, and the third line -- the coordinates of Berlaga. All defined points are pairwise distinct. It is guaranteed that Berlaga and Skumbriewitz didn't move while Ostap was swimming.

출력

The input file must contain a single real number -- the length of the shortest trajectory from the initial position of Ostap to Skumbriewitz's buoy, given that the angle between the tangent to the trajectory and the direction to Berlaga was constant. Print the answer with a relative or absolute error not greater than 10−810^{-8}.

예제1

  1. 예제 1

    입력
    10 0
    -10 0
    0 0
    
    예상 출력
    31.4159265359