WA in SWAPPALI

https://www.codechef.com/viewsolution/29978089
Can anyone check what am i missing or suggest any testcase in which this code fails?