Logic is correct for sample case but still getting wrong answer for all test cases

code link: https://ide.codingblocks.com/s/232954

@siddharth9k9
it 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