Marbles problem (please help me to debug)

@amangoel987357 iy is told in the problem statement that ans can exceed 64 bit int limit hence you cannot store ans in long long int you have to use bigint() here
Take a look at its implementation here