#C3402. Maximum Bacteria Count Difference

    ID: 46826 Type: Default 1000ms 256MiB

Maximum Bacteria Count Difference

Maximum Bacteria Count Difference

You are given an integer \(n\) representing the number of days and a list of \(n\) integers that represent the bacteria counts recorded on each day. Your task is to determine the maximum difference in bacteria counts observed between any two days. The difference is computed using the formula:

\(\text{difference} = \max(\text{bacteria\_counts}) - \min(\text{bacteria\_counts})\)

If the number of days is less than 2, output the error message "The number of days must be at least 2.".

inputFormat

The input is read from standard input (stdin). The first line contains an integer (n) representing the number of days. The second line contains (n) space-separated integers representing the bacteria counts for each day.

outputFormat

Output to standard output (stdout) a single integer representing the maximum difference in bacteria counts. If (n < 2), output the exact error message: "The number of days must be at least 2.".## sample

5
3 8 2 7 10
8