Code running perfectly fine on Code Blocks but getting runerror on hackerblocks

https://ide.codingblocks.com/s/51673
https://hack.codingblocks.com/contests/c/537/52

what is going wrong in this code???
question is prateek love candies in hackerblocks.