#C5441. Working Hours Calculation
Working Hours Calculation
Working Hours Calculation
You are given a list of employee working hours provided as strings in the format "Name: hours"
. Your task is to calculate the total working hours and the average working hours among all employees. The average should be computed using the formula:
\( \text{Average} = \text{round}(\frac{\text{Total Hours}}{\text{Number of Employees}}) \)
If there are no employees, both the total and the average should be considered as 0.
The input is read from standard input (stdin) and the output should be printed to standard output (stdout).
inputFormat
The first line of the input contains an integer \( n \) indicating the number of employees. The following \( n \) lines each contain a string in the format "Name: hours"
, where Name
is a string and hours
is an integer representing the number of working hours.
outputFormat
Output two integers separated by a space: the first is the total working hours and the second is the average working hours (rounded to the nearest integer).
## sample3
John Doe: 40
Jane Smith: 55
Robert Brown: 32
127 42