#C8753. Average Speed Calculation
Average Speed Calculation
Average Speed Calculation
Given the distances run and the times taken by several participants, compute the average speed.
For each participant, the speed is computed as:
\( speed_i = \frac{distance_i}{time_i} \)
The overall average speed is defined as:
\( average = \left\lfloor \frac{\sum_{i=1}^{n} \frac{distance_i}{time_i}}{n} \right\rfloor \)
where \(\lfloor x \rfloor\) denotes the floor function (i.e. rounding down to the nearest integer).
You are required to read input from stdin and output the result to stdout.
inputFormat
The input consists of three lines:
- The first line contains an integer ( n ) representing the number of participants.
- The second line contains ( n ) space-separated integers representing the distances (in kilometers).
- The third line contains ( n ) space-separated integers representing the times (in hours).
outputFormat
Output a single integer that represents the average speed of the participants computed as described above, rounded down to the nearest integer.## sample
3
10 20 30
1 2 3
10
</p>