Human Pipeline
Time limit1.5sMemory limit1024 MB
Split N people into two nonempty teams so the larger of the two team times ceil(K / (min speed times team size)) is minimized.
- Level
Medium6 of 10
- Topics
- Greedy, Sorting, Binary search, Math
- Solved
- No attempts yet
Problem
Today is an important day. It is the day of SUAPC.
Despite how important the day is, unfortunately there is work to do. Today's task is to move boxes to suitable places.
Since boxes are far too many for one person to carry alone, SUAPC participants have gathered to carry the boxes. All of them want to finish the work as quickly as possible and join SUAPC.
The participants decided to split into two teams and work. The two teams do not need to carry the same number of boxes. Each team must contain at least one person. Person 's work speed per minute is , and a team's work speed is
When a team carrying boxes has work speed per minute, the team takes minutes to finish the work.
So that everyone can happily join SUAPC, split the people into two teams appropriately so that all boxes are carried as fast as possible, and find the time when the two teams start carrying boxes at the same time and finish the earliest.
Input
The input is given as follows.
- is the number of people gathered. ()
- is the number of boxes to move. ()
- is the work speed of person per minute, meaning they can move boxes in one minute. ()
- All numbers in the input are integers.
Output
Print the work time in minutes for the case that moves all boxes as fast as possible.