Mow

TimeLimit:1000MS  MemoryLimit:524288KB
64-bit integer IO format:%I64d
Special Judge
未提交 | 登录后收藏
Problem Description
Nick is in charge of managing a lawn which can be represented as a convex polygon.

Since he didn’t manage the lawn for a long time, the grass has grown up too long and he doesn’t like it. So, he decided to mow the grass in the lawn.

He can either mow the grass by hand or hire a mowing machine.

Mowing by hand costs A euro(s) per unit area and hiring a mowing machine costs B euro(s) per unit area. Unfortunately, the circle-shaped mowing machine must not get out of his lawn while mowing, that is, any point of the machine must be strictly inside the lawn or on the border. The machine cuts all the grass in its circle.

Any grass is considered to be cut only once even though the machine passed over it several times.

Find out the minimal amount of money he needs for mowing his lawn.
Input
The first line contains an integer T (1≤T≤100), denoting the number of test cases.

The first line of each test case contains two integers n (≤200) and r (0<r≤10000), which is radius of the machine.

The next line contains two integers A and B (0≤A,B≤1000).

Following n lines contain two integers $x_i$ and $y_i$ (|$x_i$ |,|$y_i$ |≤10000), coordinates of points representing his lawn in order of traversal.

It is guaranteed that r is not equal to the radius of inscribed circle.
Output
Output a single line containing the minimal amount of money you need.

Your answer will be considered correct if its absolute or relative error doesn’t exceed $10^{-6}$).
SampleInput
1
4 1
1 0
0 0
4 0
4 4
0 4
SampleOutput
0.858407346410
Submit
题目统计信息详细
总AC数0
通过人数0
尝试人数0
总提交量0
AC率0.00%
AC该题后可以添加标签
贴完标签可以获得20ACB。
并且可以获得本题所有提交代码查看权限。
点击标题可以显示标签。
如果你还没认真思考过这题,请不要查看标签
如果您已经通过了该题,请务为该题贴上标签

T^T Online Judge

[BUG反馈] [FAQ] [闽ICP备17026590号-1]
当前版本:3.24 系统时间: