r/pythonhelp • • Feb 02 '22

HOMEWORK Hey! Does anyone know how to solve this python problem?

Hi, can anyone help me with solving this problem:

Snail - a wall climber 

A snail climbs on a wall, it starts at the bottom and climbs up n meters a day. Regretfully, every night it slides m meters down. Given the height of the wall, H write a program to calculate how many days required for the snail to reach the top of the wall. 

Input: 3 non-negative integers n,m H separated by a space e.g 3 2 11 

Output: a single integer number, which is the number of days required for the snail to reach the top of the wall. E.g 9 

If the snail will never be able to reach the top of the wall print FAIL

0 Upvotes

1 comment sorted by