408715: GYM103270 E Pet Pens (I)

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Pet Pens (I)time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

George is building a massive pet store, so he can share his love of various animals with the rest of the world. However, he knows that certain pets are quite territorial and won't behave well if they don't have enough personal space.

Each pet will requires its own rectangular area of personal space. However, George isn't too skilled at building out rectangular pens, so he's instead decided to construct a circular pen for each pet that is guaranteed to fully contain the pet's required rectangular area. Note that it isn't sufficient to build a circular pen that has a greater area than the rectangle because the circular pen must contain the entire rectangle itself. Ideally, to cut down on costs, George wants to minimize the total area of circular pens built for each pet.

Given the $$$n$$$ pets at George's pet store and the rectangular areas that each pet requires, figure out the minimum total area required to build out the circular pens for each pet. Your answer will be judged correct if it is within $$$10^{-4}$$$ of the true solution.

Input

The first line will consist of a single integer $$$n (1 \leq n \leq 10^5)$$$. The next $$$n$$$ lines will consist of two numbers $$$h_i$$$ and $$$w_i$$$ ($$$1 \leq h_i, w_i \leq 10^5$$$), which indicates that the $$$i$$$th pet requires a rectangular area of height $$$h_i$$$ and width $$$w_i$$$.

Output

Output a single real number giving the total minimal area of the circular pens that will fully contain each pet's required rectangular area.

ExamplesInput
1
1 1
Output
1.5707963267948968
Input
2
2 4
4 2
Output
31.415926535897935
Note

For the first sample, George will construct a singular circular pen with radius $$$\frac{1}{\sqrt{2}}$$$, which gives the corresponding area.

加入题单

算法标签: