Infinite Slides

시간 제한2초메모리 제한512 MB

요약
반지름 1인 무한 나선을 같은 각속도로 도는 두 사람이 있고 Beata가 W초 늦게 출발할 때, 두 사람 사이 유클리드 거리의 최솟값을 구한다.
난이도

보통10점 중 7점

유형
수학, 기하, 이분 탐색, 정렬
정답자
아직 제출이 없습니다

문제

Agneta and Beata are visiting the famous Swedish Amusement Park of Infinite Fun and Games. Their favourite attraction is the Infinitely Long Slides. Each slide can be viewed as an infinitely long, completely vertical spiral of radius 11.

When projected into the (flat) ground, the first slide has (0,0)(0, 0) as its centre point, and the second one has (1,0)(1, 0) as its centre point. Furthermore, the start of the slides are at (1,0)(1, 0) and (2,0)(2, 0) respectively, and then proceeds counter-clockwise around their respective centres. When Agneta rides her slide (the first one), she does so with vertical speed 1 m/s1\text{ m/s}, while Beatas slide has a bit higher gradient, so she goes with vertical speed 2 m/s2\text{ m/s}. However, their angular speeds around the centre is both equal to 1 rad/s1 \text{ rad/s}. Since Beata is a little afraid of the slides, she always waits for Agneta to go first. WW seconds after Agneta went, Beata starts her descent.

To make the infinite ride a bit more fun, the amusement park gives a price if the two riders on the slides manage to pass a ball between them at some point. This price consists of a lot of chocolate, which is Beata's favourite treat. To maximize their chances of passing the ball successfully, they want to wait until their Euclidean distance is the smallest possible during the ride. How small will this distance be?

입력

The first and only line of the input contains the decimal number 0≤W≤10000 \le W \le 1000. The number contains at most 66 digits after the decimal point.

출력

Output a single number -- the minimal Euclidean distance between Agneta and Beata during their trip. Your answer will be accepted if it is within a relative or absolute error of 10−410^{-4} of the judges' answer.

예제4

  1. 예제 1

    입력
    0
    
    예상 출력
    1
    
  2. 예제 2

    입력
    6.283185
    
    예상 출력
    1
    
  3. 예제 3

    입력
    42
    
    예상 출력
    1.5228490019
    
  4. 예제 4

    입력
    1.047198
    
    예상 출력
    2