Torus Travel
시간 제한1초메모리 제한512 MB
토러스 위에 같은 간격으로 놓인 n개의 작은 도로와 4개의 큰 도로가 있을 때, 안쪽 도로의 도시에서 출발해 모든 나라를 지나는 최소 이동 거리를 구한다.
문제
Torus is a surface that composed of points at a distance of from a circle with radius in 3D space. is then called a central circle of a torus; line perpendicular to the plane of that also contais the center of is called torus' axis; and 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 and it's plane contains torus' axis.
Young traveler Senya lives on a torus-shaped planet with major radius and minor radius . There is a regular road map on this planet: lesser roads at equal distance from each other (located on lesser circles), and 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 countries. Each country has only cities on the intersections of it's lesser road with all bigger roads.


Left picture illustrates the definition and shows minor and major radiuses. The right one shows greater roads and 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: , --- minor and major torus radiuses and --- number of countries (; ).
출력
Output should contain one real number --- minimal distance Senya has to cover. Your answer should have an absolute or relative error not greater than .
힌트
In the second example let represent the cities of -th country on the inner, southern, nothern and outer roads, accordingly. One of the minimal paths looks like: . Covered distance equals to of country length, two segments of inner road and one of southern. So the answer is .