Skip to main content
Back to problems
Codeforces
Easy
Arrays
Math
Greg's Workout

Track the cumulative exercise load over a week and report the minimum, maximum, and chosen-day totals.

Acceptance 0%
Also Available On
Other platform versions and source mappings for the same problem.
Problem Statement

Problem

Greg performs a workout routine for 7 days. On the ii-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 a1,a2,,a7a_1, a_2, \dots, a_7.
  • Each aia_i denotes the number of exercises done on day ii.

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.
Examples
Sample cases returned by the problem API.

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.

Guided hints
Editorial and discussion links
Concept map and variants
Sign in to unlock
Track your progress
Sign in to bookmark this problem, save notes, and manage its revision plan.