Wrong Answer - MARBLES

The code is giving the wrong answer, I have submitted the same code on spoj and it got accepted then why is it showing answer here?