Help -- KRILLIN problem getting WA

Link to problem : CodeChef: Practical coding for everyone

My submission : CodeChef: Practical coding for everyone

Getting WA – need help

EDIT : It’s accepted now. Did a very silly mistake of specifying wrong datatype in getKth function where I wrote int K and the only fix required was long long K – but it took many hours to observe this :frowning: