Where I am wrong??

ranklist
wa

#1

Problem : RANKLIST

Solution : Link

I am unable to figure out where i am wrong. Please help. Thanks in Advance.


#2

Input:
1
11 17

Correct output: 7
Your output: 6