编程介的小学生 2017-08-03 02:12 采纳率: 20.5%
浏览 716
已采纳

Hero’s assistant

Problem Description
There is an old country and the king fell in love with a devil. The devil always asks the king to do some crazy things. Although the king used to be wise and beloved by his people. Now he is just like a boy in love and can’t refuse any request from the devil. Also, this devil is looking like a very cute Loli.

Y*wan find that the only way to save this country is to kill every loli. Y*wan is fine about that because he doesn't like loli. But the princess's knight's member just thinks he is insane. So they compete in an algorithm contest.

In this contest, Y*wan suck at this problem, if y*wan can't win, the mankind will become extinct, so it's your turn to help y*wan solve this problem.

There are n points in the plane, you pick a random point in [0,X] x [0,Y], after that you output the second nearest squared distance from this point to those n points. What is the expectation of your output?

Input
The first line contains an integer T, denoting the number of the test cases.
For each test case, the first line contains 3 integers n,X,Y.
The next n lines, each contains 2 integers x, y, denote that there is a point x,y.

T<=5,2<=n<=100.
0<=X,Y<=100 , -200<=x,y<=200

Output
For each test case, output the answer in one line.
This problem is special judged. The relative error less than 1e-6 will be accepted.

Sample Input
1
2 10 10
0 0
10 10

Sample Output
100.0000000000

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-08-17 15:54
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 求各位懂行的人,注册表能不能看到usb使用得具体信息,干了什么,传输了什么数据
  • ¥15 个人网站被恶意大量访问,怎么办
  • ¥15 Vue3 大型图片数据拖动排序
  • ¥15 Centos / PETGEM
  • ¥15 划分vlan后不通了
  • ¥20 用雷电模拟器安装百达屋apk一直闪退
  • ¥15 算能科技20240506咨询(拒绝大模型回答)
  • ¥15 自适应 AR 模型 参数估计Matlab程序
  • ¥100 角动量包络面如何用MATLAB绘制
  • ¥15 merge函数占用内存过大