| UTPC Contest 1-28-2026 |
|---|
| Finished |
Edward is really really thirsty and he wants to drink $$$n$$$ cups of hot cocoa.
Each of these cups have an associated heat, but decrease by $$$d$$$ heat every second.
Since Edward is really really really thirsty, he can consume hot cocoa instantly once the temperature of a cup drops equal to or below $$$h$$$.
What is the earliest time that Edward can satiate his thirst by finishing all cups of cocoa?
The first line contains $$$n$$$ the number of cups, $$$d$$$ the rate that the cups cool down, and $$$h$$$ the temperature for Edward to consume the cup. $$$1 \leq n, d, h \leq 10^5 $$$
The second line contains $$$n$$$ integers, $$$c_1, c_2, ..., c_n$$$, representing the initial heat of the cups. $$$1 \leq c_i \leq 10^9$$$
Output one integer $$$t$$$, the first time in which Edward can finish all the cups.
3 2 11 4 2
2
In the sample testcase, Edward can consume the first mug at $$$t=0$$$, the second at $$$t=2$$$, and the third at $$$t=1$$$.
| Name |
|---|


