#K49767. Calculate CO2 Emissions
Calculate CO2 Emissions
Calculate CO2 Emissions
You are given the details of a journey divided into n segments. For each segment, you are provided with the distance d (in miles) and the fuel consumption rate f (in gallons per mile). The task is to calculate the total CO2 emissions generated over the journey using a fixed conversion factor.
The formula to compute the emissions for each segment is given by:
and the total emissions is:
$$\text{Total Emissions} = \sum_{i=1}^{n} d_i \times f_i \times 20 $$Output the result rounded to two decimal places.
inputFormat
The input is read from stdin and consists of:
- An integer
n
on the first line, representing the number of journey segments. n
subsequent lines, each containing two numbers: a floatd
(distance in miles) and a floatf
(fuel consumption rate in gallons per mile), separated by space.
outputFormat
Print to stdout a single line with the total CO2 emissions in pounds, rounded to two decimal places.
## sample1
100 0.05
100.00