This question evaluates a candidate's proficiency in algorithm design, particularly applying binary search over a monotonic answer space and managing integer versus floating-point precision when maximizing piece length.
You are given N cables with integer lengths and a target K. Cut the cables into pieces of equal integer length L to produce at least K pieces; maximize L. If impossible, return 0. Describe an algorithm using binary search on the answer and analyze its complexity. Follow up: support non-integer lengths with precision 1e-3.