With the looming climate crisis, we need to find more renewable sources of energy. One such renewable source is to use hydro-electricity, using a dam at the top of existing river falls. The potential for electricity production is based on height of the fall and the quantity of water that flows in that fall.
More precisely, the amount of energy that we can get is calculated using the following formula:
\[ E = mgh \]where:
$E$ = energy (in joules)
$m$ = mass (in kilograms) – since water has a mass of $1$ kg per litre, we can use the number of litres that flows in the fall here
$g$ = gravitational acceleration – always $9.81\, m/s^2$ on the earth, but we will round up to $10$ for our purposes here
$h$ = height of the fall (in metres)
We would like to compare three different falls in the province as potential places to put a hydro-electricity dam. Your work here will be to take the given volume of water for each fall and that fall’s height, and calculate the potential energy we could get for each of these falls.
In our example input, the first fall has a volume of $100$ litres and a height of $50$ metres, the second fall has a volume of $150$ litres and a height of $25$ metres, and the third fall has a volume of $160$ and a height of $30$ metres. For the first fall, the calculation would be
\[ E = mgh = 100 * 10 * 50 = 50,000 \]This value, $50,000$, is the first of the three lines of the example output.
More precisely, the input contains information for $3$ possible falls, as $2$ numbers (positive integers) for each fall, each on a separate line. The first of the two numbers is the volume (in litres) and is at most $100,000$. The second number is the height (in metres) and is at most $100$.
The output consists of three lines, each one containing on integer that represents the potential energy (in joules) available from a fall. The first line is for the first fall in the input, the second line is for the second fall in the input, and the third line is for the third fall in the input.
Sample Input 1 | Sample Output 1 |
---|---|
100 50 150 25 160 30 |
50000 37500 48000 |