My code is not working for all the test cases. I am not able to figure out my mistake. I need help.
Marble problem in maths section
@nayakashutosh99 it is not mentioned in the problem that you have to calculate ans taking modulo,and hence your ans can exceed 64 bit so you should use bigint() here to store your answer.
Take a look at its implementation here https://github.com/robinrst/HackerBlocks/blob/master/MARBLES.cpp
and here i have updated your code by storing ans in bigint (https://ide.codingblocks.com/s/204451)