Note to plugin users: There is an image in the problem examples. Please use the applet to view it.
After laser surgery, I was instructed to put drops in my eyes 6 times a day,
spacing them as far apart as possible. Considering that I sleep for some
period each day, it required some calculation to come up with an optimal
schedule. Recognizing that I get similar instructions every time I get
medication from the doctor, it became clear that a computer program was needed.
Create a class EyeDrops that contains a
method closest that is given sleepTime, the number of hours that the patient
sleeps each day, and k, the number of doses required each day. The method
returns the number of minutes between the closest doses, when the schedule
is chosen to make this period as large as possible. You should assume that the
patient sleeps for the same continuous period each day.
The schedule that you choose will be applied for multiple days, so the period
between closest doses may be between doses on different days.
