408708: GYM103269 E Pet Pens (I)
Description
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.
InputThe 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$$$.
OutputOutput a single real number giving the total minimal area of the circular pens that will fully contain each pet's required rectangular area.
ExamplesInput1 1 1Output
1.5707963267948968Input
2 2 4 4 2Output
31.415926535897935Note
For the first sample, George will construct a singular circular pen with radius $$$\frac{1}{\sqrt{2}}$$$, which gives the corresponding area.