In this case, the problem is floating points always lose precision and become nondeterministic, especially when dealing with conversions, which can only be deterministic by using protected fractions. Since you can't access external libraries for this problem, you have to overcome the precision issue a different way.
Loved this challenge! Made me think twice. ()