The Goat
Time limit1sMemory limit128 MB
Compute the expected area eaten when a goat is tied for k days to uniformly random stakes of length l, where overlaps depend on disk-pair geometry.
- Level
Medium7 of 10
- Topics
- Probability, Geometry, Math, Combinatorics
- Solved
- No attempts yet
Problem
Farmer Byteman drove stakes into the ground of an infinite pasture. Over the next days, each morning the farmer takes his goat out to the pasture and ties it, with a cord of length , to a stake chosen uniformly at random among the stakes. During that day the goat eats all the grass within its reach. To the goat's dismay, the grass does not grow back. It can also happen that the absent-minded farmer ties the goat to the same stake on more than one day.
What is the expected value of the area of the pasture whose grass has been eaten after days?
Input
The first line contains three integers , , and (), denoting the number of stakes, the number of days, and the length of the cord, respectively. Each of the next lines contains the coordinates of one stake as a pair of integers , (). No two stakes are placed at the same location.
Output
Print a single real number: the expected area of the pasture whose grass the goat eats over the days, rounded to exactly six digits after the decimal point.
Hint
Consider two stakes over two days. If the goat is tied to the same stake on both days, the eaten area equals ; if it is tied to two different stakes, the area equals . Averaging the four equally likely outcomes gives .