Issue with running code in codechef IDE

https://www.codechef.com/viewsolution/32020494

if you run this submission in codechef ide , by selecting the problem TEST

it gives runtime execption

use inputs which don't have 42

but if you submit this , you will get AC

can someone have a look at this?