#K5951. Water Status Evaluation
Water Status Evaluation
Water Status Evaluation
You are given a list of water amounts provided over a period of days along with two threshold values: the minimum required water and the maximum allowed water. Your task is to calculate the total water received over the days and determine its status based on the following conditions:
( \text{Let } S = \sum_{i=1}^{n} water_list[i] )
- If ( S < min_threshold ): output "Needs more water"
- If ( S > max_threshold ): output "Overwatered"
- Otherwise, output "Just right"
The problem requires you to read input from stdin and write the result to stdout. Make sure to follow the input and output formats exactly.
inputFormat
The input is given in three lines:
- An integer ( n ) representing the number of days.
- ( n ) space-separated integers representing the water provided each day.
- Two space-separated integers representing the minimum threshold and the maximum threshold.
outputFormat
Output a single line to stdout that is one of the following strings: "Just right", "Needs more water", or "Overwatered", depending on the total amount of water relative to the given thresholds.## sample
4
5 3 2 4
10 20
Just right