#C8194. Find Kth Eliminated Contestant's Strength
Find Kth Eliminated Contestant's Strength
Find Kth Eliminated Contestant's Strength
You are given \( n \) contestants with various strengths. The elimination process follows the rule that contestants are removed in increasing order of their strength. In other words, if the strengths are sorted as \( S_1 \le S_2 \le \cdots \le S_n \), then the contestant eliminated in the \( k^{th} \) round has strength \( S_k \). Your task is to determine and output the strength of the contestant eliminated in the \( k^{th} \) round.
inputFormat
The input consists of three lines:
- The first line contains an integer ( n ), the number of contestants.
- The second line contains ( n ) space-separated integers representing the strengths of the contestants.
- The third line contains an integer ( k ), indicating the elimination round to query.
outputFormat
Output a single integer which is the strength of the contestant eliminated in the ( k^{th} ) round.## sample
5
4 3 7 1 5
3
4