I have done the above program by myself but it is not passing any test cases


It is working fine in my compiler but is not passing test cases.

Is it giving TLE or wrong answer?

It is giving wrong answer


Try this code. Also, please send me the question link on hackerblocks.

https://hack.codingblocks.com/app/practice/1/203/problem Still it is not passing any test case

I think there is some internal error in the test cases. I will report this to the team.

Use long long int for all variables.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.