apple pie's submission of K-th Maximum | CodeChef