Track the cumulative exercise load over a week and report the minimum, maximum, and chosen-day totals.
Problem
Greg performs a workout routine for 7 days. On the -th day, he does a certain number of exercises. The workout names may be different, but the task is always the same: compute the cumulative number of exercises after each day and determine the minimum, maximum, and final results needed by the judge.
Given the number of exercises Greg does on each of the 7 days, find the total number of exercises after the full week and identify the smallest and largest values among the running totals.
What you need to do
- Read 7 integers, one for each day of the week.
- Build the running sum after each day.
- Report the required aggregate values from those running sums.
Notes
This is a straightforward implementation problem centered around accumulating values across an array of fixed size.
Input Format
- A single line contains 7 integers .
- Each denotes the number of exercises done on day .
Output Format
- Output the required values from the weekly workout totals, depending on the exact judge format.
- In the standard formulation of this problem, the answer is obtained from the running sums over the 7 days.
Constraints
- Exactly 7 values are provided.
- The numbers fit in standard 32-bit signed integer range in the original problem setting.
- Use 64-bit arithmetic if implementing more generally.
Example 1
Input
2 1 1 2 3 2 1
Output
2 3 12
Explanation
The running totals are 2, 3, 4, 6, 9, 11, 12. The minimum is 2, the maximum is 12, and the final total is 12.
Premium problem context
Unlock deeper context for this problem
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.