Points on a Circle
Time limit2sMemory limit512 MB
Given n random points on a unit circle and an angle p, compute -log2 of the probability that all n points fit inside some arc of central angle p.
- Level
Hard8 of 10
- Topics
- Probability, Math, Combinatorics, Implementation
- Solved
- No attempts yet
Problem
You place points at random on the circumference of a circle of radius 1. Each point is equally likely to land anywhere on the circumference.
Let be the probability that all points lie on one arc of that same circle whose central angle is at most degrees. The arc may begin at any point of the circumference.
Because can be extremely small, print instead of .
Input
The first line contains the number of points and the angle . (, )
Both and are positive integers.
Output
Print with exactly six digits after the decimal point, rounded at the seventh digit.