#C11908. Grade Difference Calculator
Grade Difference Calculator
Grade Difference Calculator
You are given a list of integers representing the scores of students. Your task is to compute two things:
- The maximum grade difference, which is defined as (\max(s) - \min(s)), where (s) is the set of scores.
- The minimum grade difference between any two adjacent scores when the list is sorted.
For example, if the scores are 45, 90, 78, 34, 59, and 80, then the maximum difference is (90 - 34 = 56) and the minimum adjacent difference is 2.
Input is to be read from standard input and output is to be printed to standard output.
inputFormat
The first line contains an integer (n) denoting the number of scores. The second line contains (n) space-separated integers representing the scores.
outputFormat
Output two space-separated integers: the maximum grade difference and the minimum grade difference.## sample
6
45 90 78 34 59 80
56 2
</p>