[Solution] X Jumps CodeChef Solution
Problem
Chef is currently standing at stair and he wants to reach stair numbered .
Chef can climb either steps or step in one move.
Find the minimum number of moves required by him to reach exactly the stair numbered .
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of a single line of input containing two space separated integers and denoting the number of stair Chef wants to reach and the number of stairs he can climb in one move.
Output Format
For each test case, output the minimum number of moves required by him to reach exactly the stair numbered .
Explanation:
Test case : Chef can make moves and climb steps in each move to reach stair numbered .
Test case : Chef can make a minimum of moves. He can climb steps in of those moves and step each in remaining moves to reach stair numbered .
Test case : Chef can make moves and climb step in each move to reach stair numbered .
Test case : Chef can make moves and climb step in each move to reach stair numbered .
No comments:
Post a Comment