#Lutece2684. Dongxue Daisuki Benzhu
Dongxue Daisuki Benzhu
Migrated from Lutece 2684 Dongxue Daisuki Benzhu
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Dongxue daisuki Benzhu, but Benzhu thinks Dongxue is getting too close. So Benzhu figures out a way to keep some distance from Dongxue.
The positions of Dongxue and Benzhu can be regarded as two points in a two-dimensional coordinate system. In the beginning, Dongxue and Benzhu are both at .
Benzhu gives Dongxue pairs of integers in order, the -th of which is and . Each time Benzhu gives a pair, Dongxue will choose a real number in the range of uniformly and randomly, represented as . Then Dongxue will go to a random point at a distance of from the current position. In detail, if he locates at , he will choose a point uniformly and randomly on the circumference of the circle whose center is and radius is .
Both Dongxue and Benzhu want to know how close they will be in the end. Let's denote the final Euclidean distance between them by . Please calculate the expectation of , i.e. . The Euclidean distance of two points and is .
Input
The first line of the input contains only one integer () indicating the number of pairs Benzhu gives Dongxue.
For the next lines, the -th line contains two integers () indicating the -th pair Benzhu gives Dongxue.
Output
Print , rounded to three decimal places.
Samples
1
1 2
2.333
2
1 2
1 3
6.667
Resources
电子科技大学第十二届 ACM 趣味程序设计竞赛