Problem Summary
Given N pieces of wood with integer length L[i], cut them into equal to or more than K pieces with the same integer length. Find the maximum length of the small pieces.
Solution
This is typical problem that can be solved with binary search.
Be careful about integer overflow and use long long to calculate the sum of L[i].
Code
|
|