Can anybody provide the solution of gfg elite batch's geek and arithmetic problem's solution?

I’ve written code for that problem and it is running correct for test cases but in online compiler answer is wrong.

We don’t generally just give answers here. Better approach is to provide us a link to your project or paste the code in here if it is not too large. Also provide a link to the problem you are trying to solve.