As you all know, Hugo still hasn't repaid his chocolate coin debt. Currently, he owes one chocolate coin to each of $n$ people. Person $i$ demanded a chocolate coin with radius $r_i$ and height $h_i$ (Each chocolate coin can be modelled as a cylinder). Please find the total volume of chocolate coins that Hugo has to buy.
Input
The first line of the input contains an integer $n$.
The second line of the input contains $n$ real numbers: $r_1, r_2, \cdots, r_n$.
The third line of the input contains $n$ real numbers: $h_1, h_2, \cdots, h_n$.
All real numbers given are corrected to at most 5 decimal places.
Output
Output the answer, corrected to 5 decimal places.
Constraints
For all cases: $1 \le n \le 10^4, 10^{-5} \le h_i, r_i \le 100.$
Subtask 1 (30%): $n=1, 1 \le h_i, r_i \le 10,$ each of $h_i$ and $r_i$ are integers
Subtask 2 (30%): $n\le100, 1 \le h_i, r_i \le 100$
Subtask 3 (40%): No additional constaints
Sample Test Cases
Input | Output | |
---|---|---|
2 3 4 5 6 |
442.96456 | |
The answer is $\pi \cdot 3^2 \cdot 5 + \pi \cdot 4^2 \cdot 6 \approx 442.96456$. | ||
1 100 100 |
3141592.65359 |
Scoring: Per Subtask
Authored by s17r28
Appeared in 2023 Wah Yan Interschool Olympiad in Informatics 🤯🥷⚡🧠🏆