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.