Expected Distance
시간 제한1초메모리 제한2048 MB
원 위에 놓인 n명의 친구에 대해, 모든 친구를 한 반평면에 담을 수 없는 '좋은 점'에서 가장 가까운 k번째 친구까지의 평균 거리를 구한다.
문제
Svetozar is passionate about robotics. He loves to test his robots on a flat, perfectly round platform in his backyard. Today, he invited of his friends and positioned each of them at the edge of this platform (that is, on the circumference), each at different points.
Svetozar is now planning to position his new robot at some good point on the platform, and then command it to determine the -th closest friend to the robot (if there are several, choose any) and walk straight to that friend. Svetozar calls a point on the platform good if there is no half-plane containing all his friends, the boundary of which passes through the given point.
Now Svetozar is interested in the expected distance the robot will travel if its initial point is equally likely to be chosen from all good points.
입력
The first line contains two integers and (, ): the number of Svetozar's friends involved, and the parameter for the robot.
The second line contains integers (, for ). Here, denotes the angle between the direction to the north and the direction from the center of the platform to Svetozar's -th friend counterclockwise, in thousandths of a degree.
출력
Print a single real number: the expected distance, measured in radii of platform. The answer will be considered correct if its absolute or relative error does not exceed .