Canadian Computing Competition: 2000 Stage 1, Senior #4
Roberta the Robot plays a perfect game of golf. When she hits the golf ball it always goes directly towards the hole on the green, and she always hits exactly the distance that is specified for the club. Each such action is known as a stroke, and the object of golf is to hit the ball from the tee to the hole in the fewest number of strokes. Roberta needs a program to select the best combination of clubs to reach the hole in the fewest strokes. She also needs to decide if the task is impossible, in which case she graciously acknowledges the loss. Roberta can carry up to
Input Specification
The first line of input gives the distance from the tee to the hole, an integral number of metres between
Output Specification
If Roberta can get the ball from the tee to the hole, without passing the hole, print Roberta wins in n strokes.
where Roberta acknowledges defeat.
.
Sample Input
100
3
33
66
1
Sample Output
Roberta wins in 3 strokes.
Comments
Did this get a new test case?
kdrkdr's dad tried to cheese the problem (:
:monkey:
is the golf field 1 dimensional?
Effectively, yes.
Can Roberta use a club more than once?
Yes.