2045. Cutting Ribbons

Medium
Array
Binary Search

Description

Hints

Hint 1
Use binary search on the answer.
Hint 2
You can get l/m branches of length m from a branch with length l.

Statistics

Acceptance
53.0%
Submissions
164,288
Accepted
87,022