Logo
(追記) (追記ここまで)

19737번 - Torus Travel 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB75252237.931%

문제

Torus is a surface that composed of points at a distance of $r$ from a circle $C$ with radius $R$ in 3D space. $C$ is then called a central circle of a torus; line perpendicular to the plane of $C$ that also contais the center of $C$ is called torus' axis; $R$ and $r$ are major and minor torus radiuses, accordingly. A circle on a torus is called bigger if it's center is on torus' axis and lesser if it's radius is $r$ and it's plane contains torus' axis.

Young traveler Senya lives on a torus-shaped planet with major radius $R$ and minor radius $r$. There is a regular road map on this planet: $n$ lesser roads at equal distance from each other (located on lesser circles), and 4ドル$ bigger roads (on bigger circles): outer --- the most distant from the axis, inner --- the least distant one, and also nothern and southern equal to the central circle on the opposite sides of the planet.

Each lesser road is a property of one of $n$ countries. Each country has only 4ドル$ cities on the intersections of it's lesser road with all 4ドル$ bigger roads.

Left picture illustrates the definition and shows minor and major radiuses. The right one shows 4ドル$ greater roads and $n = 3$ lesser roads with cities on their intersections.

Senya wants to become The Great Traveler, which means that he wants to visit every country on the planet. He considers a country visited if he has traveled along the road between two different cities of this country. Of course, movement on his planet is allowed only by the roads.

Please, help Senya to find the distance he need to cover to become The Great Traveler, if he starts his journey in a city on the inner road.

입력

The first line of input contains three integers: $r,ドル $R$ --- minor and major torus radiuses and $n$ --- number of countries ($ 1 \le r < R \le 10^9$; $ 1 \le n \le 10^9 $).

출력

Output should contain one real number --- minimal distance Senya has to cover. Your answer should have an absolute or relative error not greater than 10ドル^{-9}$.

제한

예제 입력 1

1 2 1

예제 출력 1

1.570796327

예제 입력 2

1 3 4

예제 출력 2

18.849555922

힌트

In the second example let $i_k, s_k, n_k, o_k$ represent the cities of $k$-th country on the inner, southern, nothern and outer roads, accordingly. One of the minimal paths looks like: $i_1 \rightarrow s_1 \rightarrow s_2 \rightarrow i_2 \rightarrow i_3 \rightarrow n_3 \rightarrow i_3 \rightarrow i_4 \rightarrow s_4 $. Covered distance equals to $\frac{5}{4}$ of country length, two segments of inner road and one of southern. So the answer is $\frac{5}{4} \cdot 2 \pi \cdot 1 + 2 \cdot \frac{2 \pi \cdot 2}{4} + \frac{2 \pi \cdot 3}{4} = 6 \pi \approx 18.849555922$.

출처

Olympiad > Russian Olympiad in Informatics > Russia High School Programming Contest > Russia High School Programming Contest 2018 I번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /