Pereliybol
You have N open-top cylindrical vessels. Some of these cylinders are filled with a liquid of density ρ up to a certain height h_i. The objective of the game "Pourball" is to redistribute the liquid among the cylinders such that the total height of the liquid across all cylinders is minimized.
Input
The first line contains a natural number N (N ≤ 10^5), representing the number of cylinders. The second line provides N real non-negative numbers, which are the initial heights of the liquid in each of the N cylinders (measured in centimeters). It is guaranteed that no cylinder is filled beyond its capacity. The third line lists N positive real numbers, indicating the radii of the bases of the cylinders (in centimeters), where the i-th number corresponds to the i-th cylinder. The fourth line contains N real numbers, representing the heights of the cylinders (in centimeters). The final line specifies the density of the liquid in the cylinders (in kg/m^3).
Output
Output a single real number, which is the total height of the liquid in all cylinders after redistribution (in meters). The result should be accurate to at least 3 decimal places.