What is wrong in this?(GRAVEL)

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