#K1701. Total Travel Time Calculation

    ID: 24573 Type: Default 1000ms 256MiB

Total Travel Time Calculation

Total Travel Time Calculation

You are given a trip consisting of several segments. In each segment, you are provided the distance to the next city in kilometers, and the average speed (in km/h) on that segment. The total travel time is defined using the formula:

$$T = \sum_{i=1}^{n} \frac{d_i}{s_i}$$

Your task is to calculate the total travel time for the entire trip and output the result rounded to two decimal places.

Note: It is guaranteed that the speed for every segment is non-zero.

inputFormat

The input is read from stdin and has the following format:

  • The first line contains a single integer n, the number of travel segments.
  • The next n lines each contain two numbers d and s where d is the distance (in kilometers) and s is the average speed (in km/h) for that segment.

outputFormat

Output a single line to stdout showing the total travel time for the trip in hours, rounded to two decimal places.

## sample
3
150 75
120 60
300 100
7.00