I have tried every possible test case which came to my mind yet I am not able to find even a signle case where my solution is returning wrong answer. Please help ?

Here is the question link : Real Obtuse.

Here is the my solution link: Click Here.

Note that there was a confusion that my programme would not be able to detect the odd K and therefore will give output 0. But please note that the division of k is a float. So the temp will store 2.5 if K is 5, therefore either if or else-if block will be executed.