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.