Problem A
Airport Coffee

As it happens, Jonna just landed at Copenhagen Airport,
trying to make her connection to Heathrow Airport. Since her
flight from Helsinki was delayed, she must walk very quickly
from her arrival gate to the new departure gate. Normally,
Jonna walks at a speed of
The distance between Jonna’s arrival and departure gates is
Note that Jonna is carrying a bag with her left hand, so she can only carry a single cup of coffee at a time. While a bit wasteful, she may throw away a cup that still contains some amount of coffee to purchase a brand new cup.
Can you help Jonna determine where to purchase her coffee(s), in order to get to her departure gate as quickly as possible?
Input
The first line of input contains five integers
-
is the distance between Jonna’s arrival and departure gates in centimeters. -
are Jonna’s walking speeds in centimeters per second when she is not and when she is drinking coffee, respectively. -
is the number of seconds Jonna must wait until she can drink her coffee. -
is the number of seconds it takes for Jonna to drink a cup of coffee.
Then follows a line containing an integer
Output
First, output a line containing the number of carts where
Jonna should purchase coffee. Next, output a single line
containing the indices of the coffee carts where Jonna should
buy coffee. These indicies should be between
Your answer will be accepted if the time that the proposed
coffee purchasing plan takes is within an absolute or relative
error of at most
![\includegraphics[width=0.99\textwidth ]{fig.pdf}](/problems/airportcoffee/file/statement/en/img-0002.png)
Sample Input 1 | Sample Output 1 |
---|---|
100000 100 138 60 300 5 5000 20000 50000 55000 75000 |
2 0 3 |
Sample Input 2 | Sample Output 2 |
---|---|
100000 78 86 9 560 4 13505 69705 87448 92090 |
2 0 1 |