Help Required in CENS20G

https://www.codechef.com/viewsolution/37005847
Can anyone please help me with this. Why am I getting runtime error ?