K is given integer . In code when I take K as an integer it gives wrong answer but in same code when I change data type of K to float it gives correct answer . There is also confusion in problem statement ,efficiency is stated non-integer in the first paragraph and integer in the input paragraph.
It doesn't matter if you take k as float or int, if you typecast the expressions involved in comparison to float..