Home /
Expert Answers /
Computer Science /
nbsp-nbsp-i-need-code-in-python-language-fastly-problem-statement-a-power-jumper-has-the-pa691
(Solved):
i need code in python language fastly
Problem statement: A power jumper has the ...
i need code in python language fastly
Problem statement: A power jumper has the capability to increase his strength every time he takes a jump. When he takes consecutive jumps, he starts with a single unit distarice Wump and every next jump in the forward direction has the added strength (i.e. distance) of his previous two jumps. Every next fump in the backward direction has a strength (i.e. distance) of 1 unit. If he turns his directions, he loses all his concentration and strength. He is standing at a lane having a wall at its start and end. If at an instant, he is at the sfart of the lane and starts jumping consecutively, how many jumps will it take for him to reach \( \mathrm{X} \) units distance from the start? Note: He can jump only backwards and forwards. Input Format: Line 1: Total length of the lane. Ime \( 2: x \), the exact distance he has to reach. Output Format: Roturn the number of jumps he has to make. Example 1: input: Line \( 1: 2 \) Line \( 2.2 \)
Explanation: He will jump from 0 to 1 , then from 1 to 2 , then 2 to 4 , then 4 to 7 , and then 7 to 6 . So, a total of 5 jumps.