WA in Diwali Puzzle

ques: https://hack.codingblocks.com/contests/c/204/814
code: https://ide.codingblocks.com/s/63459

I have tallied this code line by line from bhaiya’s code. It fails the test case
1
99 87

How is it possible?

one bracket was missing. Got it