#P10292. [CCC 2024 J3] Bronze Count
[CCC 2024 J3] Bronze Count
Problem Description
After a contest ends, you may urgently want to know how many contestants received a bronze medal.
Gold medals are awarded to all contestants who achieved the highest score. Silver medals are awarded to all contestants who achieved the second-highest score. Bronze medals are awarded to all contestants who achieved the third-highest score.
Given a list of contestants’ scores, find the score required to receive a bronze medal and how many people got exactly that score.

Input Format
The first line of input contains a positive integer , the number of contestants.
The next lines each contain one integer, the score of a contestant.
It is guaranteed that each score is between and (inclusive), and that there are at least three distinct scores.
Output Format
Output a non-negative integer and a positive integer , separated by a space. Here, is the score required to receive a bronze medal, and is the number of contestants who got exactly this score.
4
70
62
58
73
62 1
8
75
70
60
70
70
60
75
70
60 2
Hint
[Sample 1 Explanation]
A bronze medal requires a score of , and there is one contestant who got exactly this score.
[Sample 2 Explanation]
A bronze medal requires a score of , and there are two contestants who got exactly this score.
[Constraints]
This problem uses bundled testdata.
For all testdata, it is guaranteed that , the score satisfies , and there are at least three distinct scores.
The table below shows the distribution of the points:
| Score | Description | Range |
|---|---|---|
| All scores are distinct, and the number of contestants is small. | ||
| Scores may repeat, and the number of contestants is small. | ||
| Scores may repeat, and the number of contestants can be large. |
Translated by ChatGPT 5