#P4490. Magical Garden Water Purification

    ID: 17736 Type: Default 1000ms 256MiB

Magical Garden Water Purification

Magical Garden Water Purification

Wizard Dongdong has a beautiful magical garden filled with enchanted plants and vibrant flowers. To water his garden, Dongdong has installed n sprinklers at the same height \(h\) which are connected to a clean, but distant, holy river. Each sprinkler sprays water horizontally, and under the effect of gravity \(g\) the water follows a perfect parabolic trajectory. In fact, the water from the ith sprinkler, located at \((x_i, y_i, h)\), is destined to water the corresponding thirsty magical plant located at \((x'_i, y'_i, 0)\).

Since the sprinklers are all horizontally oriented, when the water is released it carries only horizontal velocity. Under gravity, the water drops from height \(h\) to the ground in a time \(T = \sqrt{\frac{2h}{g}}\). Therefore, the water from the ith sprinkler reaches its plant exactly if its horizontal velocity is chosen as \((x'_i - x_i,\; y'_i - y_i)/T\). Moreover, the horizontal position of the water at any intermediate horizontal plane at height \(z\) (with \(0\le z\le h\)) can be computed as follows. At height \(z\) the elapsed time is \(t = \sqrt{\frac{2(h-z)}{g}}\), and if we define \[ \lambda=\sqrt{\frac{h-z}{h}}, \] then the water stream from the ith sprinkler passes through the point \[ P_i(\lambda)=\Bigl(x_i(1-\lambda)+x'_i\lambda,\;y_i(1-\lambda)+y'_i\lambda\Bigr). \]

In order to purify his water from nearby factory pollution, Dongdong can cast a spell to form a convex polygonal filter on any horizontal plane. Every water stream that passes through this filter is purified, and the magical energy cost is directly proportional to the area of the filter (1 unit of energy per square meter). In order to purify all water streams, Dongdong must choose a horizontal plane (i.e. a corresponding \(\lambda\) in \([0,1]\)) and design a convex filter that contains all points \(P_i(\lambda)\). Note that the minimum energy required is exactly the area of the convex hull of these points, and Dongdong can choose \(\lambda\) optimally to minimize that area.

Task: Given the positions of the sprinklers and their corresponding plants, compute the minimum energy needed (i.e. the minimum area of a convex polygon that covers all water-stream intersection points on some horizontal plane).

inputFormat

The first line contains three numbers: an integer \(n\) (\(1 \le n \le 10^5\)), and two real numbers \(h\) and \(g\), representing the height at which the sprinklers are placed and the acceleration due to gravity, respectively.

The next \(n\) lines each contain two real numbers \(x_i\) and \(y_i\), representing the coordinates of the ith sprinkler.

The following \(n\) lines each contain two real numbers \(x'_i\) and \(y'_i\), representing the coordinates of the ith magical plant.

outputFormat

Output a single real number — the minimum energy required (i.e. the minimum area of the convex polygon filter) with an absolute or relative error of at most \(10^{-6}\).

sample

3 10 10
0 0
10 0
0 10
10 10
0 10
10 0
0.000000

</p>