Problem H
Chugging
Languages
da
de
en
Alice and Bob have challenged each other to finish as many bottles as quickly as they can, an activity known as chugging in North American slang.
It takes Alice $t_ A$ seconds to finish the first bottle. However, the bottle contents (gas, complex carbohydrates, alcohol) have deleterious effects on performance, so the second bottle takes her $t_ A+d_ A$ seconds to finish. This effect is cumulative: with every new bottle, Alice’s chugging speed deteriorates by $d_ A$ additional seconds.
For instance, if $t_ A=10$ and $d_ A=2$ as in the sample inputs below, then Alice needs
\[ 10 + (10 + 2) + (10 + 2 + 2)=36 \]seconds to finish $3$ bottles.
The corresponding values for Bob are $t_ B$ and $d_ B$.
Who finishes first?
Input
The input consists of three lines. The first line contains the number $N$ of bottles they each have to finish, with $1\leq N \leq 10$. The second line contains the integers $t_ A$ and $d_ A$, with $1\leq t_ A\leq 120$ and $0\leq d_ A\leq 120$. The third line contains the integers $t_ B$ and $d_ B$, with $1\leq t_ B\leq 120$ and $0\leq d_ B\leq 120$.
Output
Print “Alice” if Alice finishes first, or “Bob” if Bob finishes first. If they finish at the same time, print an equality symbol, “=”.
Sample Input 1 | Sample Output 1 |
---|---|
3 10 2 8 3 |
Bob |
Sample Input 2 | Sample Output 2 |
---|---|
3 10 2 8 4 |
= |
Sample Input 3 | Sample Output 3 |
---|---|
3 10 2 8 5 |
Alice |
Sample Input 4 | Sample Output 4 |
---|---|
2 1 1 1 0 |
Bob |