2906. Golden Spire

单点时限: 5.0 sec

内存限制: 256 MB

There are some peculiar facts known about bacterium “Jandelinka Fest”, which inhabits the Jandal region. When a strain of this bacteria is exposed to air, it starts propagating uniformly in all directions so that the boundary of its population is an ideal sphere centered in the initial place of the strain habitation. The radius of the sphere is linearly increasing over time.

Moreover, bacteria do not tolerate the scent of certain aroma, so if being smoked they immediately die. This property is often used by the local ministers of religion. They decorate the temples with golden spires of fanciful forms as follows. An ideally straight thin vertical stick is set up on a flat horizontal ground surface. Some points of the stick are covered by bacteria strains (different strains are placed in different points). As different colonies may be of different bacteria species, they may have different rates of propagation. After a week monks stop the process by smoking the stick, and cover the resulting construction by golden dust. Then the spire is set up on a peak of a temple.

The spheres corresponding to distinct colonies may collide but the species are completely indifferent to each other. Hence, a point is covered by the colonies if and only if it is contained in any of the above spheres (all growing independently). Also, when bacteria reach the ground level (corresponding to zero height) they die immediately.

You are asked to find total area of the spire surface treating the stick as an ideal line. The reason is monks should estimate the amount of gold needed to finish the spire. Only spherical parts of the surface should be counted.

输入格式

The first line contains an integer $M$: the number of colonies ($1 \le M \le 2~000$). The next $M$ lines contain two single space separated real numbers each. The first ($H_i$) defines the height of the colony over the surface (given in feet). The second ($V_i$) defines the rate of propagation (the speed at which the radius increases, in inches per hour). $0 \le H_i \le 1000, 0 \le V_i \le 10$.

输出格式

The only line of the output should contain the total area of the spherical parts of the surface, in square feet. The relative error of your answer must not exceed $10^{-6}$.

样例

Input
1
0 1
Output
1231.504320
Input
2
0 1
7 1
Output
1847.256480
Input
2
0 1
7 1.5
Output
3694.512961

提示

1 foot = 12 inches, 1 week = 7 days.

12 人解决,14 人已尝试。

13 份提交通过,共有 78 份提交。

5.5 EMB 奖励。

创建: 13 年,7 月前.

修改: 6 年,11 月前.

最后提交: 4 年前.

来源: N/A

题目标签