40. Weekly Exercise Summary
Difficulty: easy · Math
Problem
Design a weekly exercise summary. You are given the number of minutes exercised on each of 7 consecutive days. Compute the total exercise time for the week and the average daily exercise time rounded to the nearest whole minute (a fractional part of exactly .5 rounds up).
Input
A single line with 7 space-separated integers: the minutes exercised on days 1 to 7.
Output
Print exactly three lines: ``` Exercise summary Total exercise duration: <total> minutes Average daily exercise duration: <average> minutes ```
Example 1
Input: 45 15 30 15 5 10 20 Output: Exercise summary Total exercise duration: 140 minutes Average daily exercise duration: 20 minutes
Explanation: The total is 140 minutes and 140 / 7 = 20 exactly.
Example 2
Input: 10 10 10 10 10 10 11 Output: Exercise summary Total exercise duration: 71 minutes Average daily exercise duration: 10 minutes
Explanation: The total is 71; 71 / 7 = 10.14..., which rounds to 10.
Example 3
Input: 0 0 0 0 0 0 0 Output: Exercise summary Total exercise duration: 0 minutes Average daily exercise duration: 0 minutes
Explanation: No exercise: total 0 and average 0.
Constraints
- 0 <= minutes on each day <= 1440
Solutions are judged against 3 sample and 11 hidden tests. Sign in to solve it · All problems