Stair jumps

You are currently standing at stair 0 and he wants to reach stair numbered X.
You can climb either Y steps or 1 step in one move.
Find the minimum number of moves required for you to reach exactly the stair numbered X.
        
       Input:-4
4 2
8 3
3 4
2 1
       Input Description: The first line of input will contain A single integer T, denoting The number of test cases.
-each test case consists of A single line of input containing two space separated integers X and Y denoting The number of stair You want to reach and The number of stairs You can climb in one move. 
       Output: 2
4
3
2
       Output Description: For each test case, output the minimum number of moves required by him to reach exactly the stair numbered X. 
       Constraints: 1<=T<=500
1<=X,Y<=100
       Explanation: Test case 1: You can make 2 moves and climb 2 steps in each move to reach stair numbered 4.

Test case 2: You can make a minimum of 4 moves. You can climb 3 steps in 2 of those moves and 1 step each in remaining 2 moves to reach stair numbered 8.

Test case 3: You can make 3 moves and climb 1 step in each move to reach stair numbered 3.

Test case 4: You can make 2 moves and climb 1 step in each move to reach stair numbered 2.

Loading...