Avtansh and Rank

0

0 votes
Easy
Problem

In every competition who comes first gets the importance. Avtansh never liked this idea because coming first is not his cup of tea. Luckily in this version of TerraTechnica he got a chance to organize a event. So, he decided not to give the importance to the one who comes first and lets give it randomly.
He decided that he will keep a number in his mind and will always keep an eye towards that rank in his event. But, he is not that much good in handling numbers and he only likes his favourite number 80. So, he decides to give this task to you. Can you help him?

In this event a user will submit his answer and some rank will be awarded instantly based on these marks you have to keep track of this rank.
 

UPDATE: 

You have to keep track of rth rank continuously.

Test Input 0:

 5 2

8 4 7 6 2 

Test Output 0:

4 7 7 7

INPUT:
First line contains number N denoting number of participants and number R denoting the random number
Second line contains N space separated numbers denoting marks obtained by participant

 

OUTPUT:
Print the marks obtained by Rth ranked participant.

 

CONSTRAINTS:
1<=N<=10^6
1<=R<=N
1<=Ni<=10^6

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?