Photograph problem(2 test case fail)

https://ide.codingblocks.com/#/s/23839
question link https://hack.codingblocks.com/contests/c/89/540

Try pasting it on ide.codingblocks.com and save it to generate a link

sir I updated the link

I think there’s something wrong with the judge. Your code looks fine.
P.S. You shouldn’t have done that modulo inverse thing. It could have been simple as this