LCC '25 Contest 1 J3 - Candyman
View as PDFCandyman, president of MCPT (Mackenzie Candy Producing Team), wants to impress the CCC (Candy Considering Competition) by sending the organizers the third sweetest candy the team has produced. (The sweeter candies are reserved for the cookie monster).
The team has made  candies, each with a certain sweetness level. These candies are stored in boxes labeled from 
 to 
. You are given a list of integers, where the 
 element represents 
, the sweetness of the candy in the box.
Your task is to determine the box number of the third sweetest candy.
Please note the memory limit. Candyman can't quite remember all the candies at once.
It is guaranteed that the sweetness of each candy is different (no two candies are made the same).
Input Specification
The first line will contain one integer .
The  line will contain a single integer, 
, representing the sweetness of the 
 candy.
Output Specification
Output the box number of the third sweetest candy.
Subtasks
Subtasks 1 [20%]
Subtasks 2 [30%]
Subtasks 3 [50%]
Sample Input 1
6
9
2
6
7
3
12Output for Sample Input 1
4Explanation of Output for Sample Input 1
There are  candies. At box number 
, the candy sweetness is the third greatest.
Sample Input 2
15
21
72
38
44
67
60
35
78
90
97
86
11
1
5
102Output for Sample Input 2
9
Comments