Can you help me figure out the mistake

only 1 test case is passing

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

You have not taken mod.

the answer is returned after taking the mod

I have taken mod at line10

Take mod at every step whereever applicable

can you please tell me thechan ges