In the question, it is mentioned that divyam can add Y or subtract Y and it has not been mentioned that divyam doesn’t know what X is.

I tried to check whether the decimal is terminating or non terminating for which I got TLE as the numbers are up to 10^18. The solution given in the editorial will fail for 1/10 or 1/5.

Divyam can either add or subtract so if the number is say 0.2 then he can add some Y to make it 1 but that same Y, if subtracted, will make it negative which can not happen.

But in the question, it is given that he can perform either addition or subtraction. The question does not mention that divyam doesn’t know the number. if it had been mentioned then we can say that the answer given is true.

Please correct me if I am wrong.

It would be great if anyone could help me out.

Thank you