fork download
  1. from array import *
  2. n=int(input())
  3. k=int(input())
  4. arr=list(map(int,input().split()))
  5. arr.sort()
  6. r=arr[k+1]
  7. print(r)
  8.  
Success #stdin #stdout 0.02s 9488KB
stdin
6
3
7 10 4 3 20 15

stdout
15