#C955. Determine the Ultimate Hackathon Winner
Determine the Ultimate Hackathon Winner
Determine the Ultimate Hackathon Winner
In a hackathon, the number of participants is always a power of 2. Each participant has a skill level represented by an integer. The competition is organized in rounds: in each round, participants are paired and compete against each other. In every pair, the participant with the lower skill level wins and advances to the next round. This continues until only one participant remains, who is declared the ultimate winner.
Mathematically, if you consider a pair of competitors with skills \(a\) and \(b\), the winner is \(\min(a, b)\). Given the initial list of skill levels, your task is to simulate the tournament and output the skill level of the final winner.
inputFormat
The input is provided in two lines:
- The first line contains an integer \(p\) representing the number of participants (a power of 2).
- The second line contains \(p\) space-separated integers where each integer denotes the skill level of a participant.
outputFormat
Output the skill level of the ultimate winner on a single line.
## sample4
3 1 4 2
1
</p>