Mock CCC '14 J1 - Love Overdose
View as PDF2014 Mock CCC by Alex and Timothy
Alice has a crush on her friend Bob, but she is too shy to express it. From an ancient recipe passed down through her family, she has concocted a vial of love potion. She plans to slip this potion into Bob's food every day so he will love her forever. The only problem is that the potion is so potent, taking too much can make Bob overdose, resulting in him being utterly indifferent towards her.
According to a note on the recipe, if some amount of the potion is
ingested one day, only  of that amount is retained in the
body on the next day, and 
 of that amount is retained on the day after
that. You are given 
 and 
, the amount of love potion in mL that
Alice gives to Bob on the first and second day, respectively, and 
,
the recommended dosage in mL, according to her recipe. Write a program
to determine whether Bob overdoses on the first day, the second day, or
neither. Note that if Bob overdoses on the first day, he cannot overdose
again on the second.
Input Specification
Three lines, containing the three non-negative integers , 
, and
, each no greater than 
.
Output Specification
If he overdoses on the first day, output Bob overdoses on day 1. If
he overdoses on the second day, output Bob overdoses on day 2.
Otherwise, output Bob never overdoses.
Sample Input 1
100
200
249
Sample Output 1
Bob overdoses on day 2.
Sample Input 2
50
100
125
Sample Output 2
Bob never overdoses.
Explanation
For the first example, Alice slips Bob  mL of the potion on day one,
of which, only 
 mL remain in Bob's body on day two. 
 mL is added on
top of the 
 mL that he ingests on day two to make 
 mL, which is
barely enough to make him overdose the recommended dosage of 
 mL.
For the second example, the amount from day one reduces to  mL on day
two, when he is given another 
 mL to yield a total of 
 mL for the
second day. 
 mL happens to be just the right dosage, so he does not
overdose.
Comments