Can you please help me by telling me whats wrong.
Test Case 5 is Wrong
Hey @manit123,
Your code and logic is correct, except for p=1, where you explicitly have to calculate the answer(formula won’t work)
Test case 5 is 0.5 and the correct output for that is 23, which also is same as given by your code.
This seems like some input output error from server end. It’ll get fixed in a while.
However,
If we don’t use the formula directly and calculate the step by step logically, all test case will pass.
You can see https://ide.codingblocks.com/s/188477 this code for your reference.
Moreover, I highly encourage you to get the logic and write your own code for the same.