#K63132. Energy State Calculation
Energy State Calculation
Energy State Calculation
You are given a list of activities performed by an individual. Each activity has an associated energy cost as follows:
- working: 8
- exercising: 5
- socializing: 3
- relaxing: -2
- sleeping: -8
Your task is to compute the Net Energy Score (NES) using the formula:
$$NES = \sum_{i=1}^{n} cost(activity_i)$$
Then, determine the energy state based on the following criteria:
- If \(NES < 0\), output
Exhausted
. - If \(0 \le NES < 10\), output
Tired
. - If \(10 \le NES < 20\), output
Balanced
. - If \(NES \ge 20\), output
Energetic
.
Note: Any activity not listed in the above table should be ignored.
inputFormat
The first line contains an integer n
representing the number of activities. The next n
lines each contain a string representing an activity.
outputFormat
Output a single line containing one of the strings: Exhausted
, Tired
, Balanced
, or Energetic
, which corresponds to the energy state.
7
working
working
working
relaxing
sleeping
sleeping
sleeping
Exhausted