Wrong answer for IALG1

Could anyone explain whats wrong with my solution for problem IALG1? I have tested for a lot of test cases and my solution appears to be similar to the accepted ones.
Link to problem: https://www.codechef.com/INAL2019/problems/IALG1/
Link to my solution: https://www.codechef.com/viewsolution/22616349

check your answer for the case 0.999999…999 this should give 1

here is my code submission

//