#C7908. Travel Journal Calculation
Travel Journal Calculation
Travel Journal Calculation
You are given a travel journal with n entries. Each entry contains the name of a city, the distance traveled (in kilometers), and the number of days stayed. Your task is to compute two values:
- The total distance traveled, which is the sum of all distances.
- The average number of days stayed, calculated as (\text{average_days} = \frac{\text{total_days}}{n}), where (n) is the number of entries.
Print the total distance and the average days (formatted to two decimal places) on a single line separated by a space.
inputFormat
The first line contains an integer (n), the number of cities. Each of the next (n) lines contains a string and two integers, representing the city name, the distance traveled, and the days stayed, respectively.
outputFormat
Output a single line with two values: the total distance traveled (an integer) and the average days stayed (a floating-point number formatted to two decimal places).## sample
2
CityA 300 2
CityB 500 4
800 3.00