UVa 573

A snail is at the bottom of a 6-foot well and wants to climb to the top.

Explanation
This is a simple ad-hoc algorithm. Increase the distance climbed by the climbing factor, decrease the climbing factor by fatigue, then slide down the snail. Be sure to check success or failure after each movement.

Implementations
Notes/Hints on actual implementation here.

Optimizations
Optimizations here.

Input
6 3 1 10 10 2 1 50 50 5 3 14 50 6 4 1 50 6 3 1 1 1 1 1 0 0 0 0

Output
success on day 3 failure on day 4 failure on day 7 failure on day 68 success on day 20 failure on day 2