Question: Snail - a Wall Climber Programming challenge description: A snail climbs on a wall, it starts at the bottom and climbs up nn meters a
Snail a Wall Climber
Programming challenge description:
A snail climbs on a wall, it starts at the bottom and climbs up nn meters a day. Regretfully, every night it slides mm meters down.
Given the height of the wall HH write a program to calculate how many days required for the snail to reach the top of the wall.
Input:
Three nonnegative integers nn mm and HH separated by a space. For example:
Output:
A single integer number, which is the number of days required for the snail to reach the top of the wall. For example:
If the snail will never be able to reach the top of the wall print Fail
Test
Test InputDownload Test Input
Expected OutputDownload Test Output
Test
Test InputDownload Test Input
Expected OutputDownload Test Output
Test
Test InputDownload Test Input
Expected OutputDownload Test Output
Test
Test InputDownload Test Input
Expected OutputDownload Test Output
Fail
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
