#C9816. Analyze Scores
Analyze Scores
Analyze Scores
You are given the scores of N students. Your task is to determine two values:
- The number of distinct scores, and
- The second highest score among the distinct scores (output -1 if there is no second highest score).
In other words, if \(S\) is the set of unique scores then you should output \(|S|\) and the second largest element of \(S\) if it exists, or \(-1\) otherwise.
The input is read from standard input and the answer must be printed to standard output.
inputFormat
The first line contains an integer \(N\), representing the number of students. The second line contains \(N\) integers separated by spaces, each representing a student's score.
outputFormat
Print two integers separated by a space: the number of distinct scores and the second highest score among them. If there is no second highest score, print -1 as the second integer.
## sample5
85 75 85 90 100
4 90