Can't find the difference why one code works and other shows runtime error? : The code is for the question [SPREAD2][1] asked in the snackdown'19 qualifier round. As the contest is over so I want to clarify why [this code][2] shows runtime error while doing it with while loop in [this code][3] works perfectly fine. Please help.


  [1]: https://www.codechef.com/SNCKQL19/problems/SPREAD2
  [2]: https://www.codechef.com/viewsolution/20871155
  [3]: https://www.codechef.com/viewsolution/20871904