Code
Loading editor...
Tap Analyze to see visualization
Click Analyze to visualize
See step-by-step execution, variables, and output
Variables
Run code to see variables
Output
Console output will appear here
Click Analyze to visualize
See step-by-step execution, variables, and output
Run code to see variables
Console output will appear here
For each candidate divisor, compute required sum of hours (ceil division). If the sum fits threshold, search smaller divisors; otherwise search larger.
If a divisor d is valid (sum <= threshold), every larger divisor is also valid. Monotonic feasibility allows binary search for the minimum valid d.
Updated Feb 2026