Vasya goes to visit his classmate Petya. Vasya knows that Petya's apartment number is $n$. 

There is only one entrance in Petya's house and the distribution of apartments is the following: the first floor contains $2$ apartments, every other floor contains $x$ apartments each. Apartments are numbered starting from one, from the first floor. I.e. apartments on the first floor have numbers $1$ and $2$, apartments on the second floor have numbers from $3$ to $(x + 2)$, apartments on the third floor have numbers from $(x + 3)$ to $(2 \cdot x + 2)$, and so on.

Your task is to find the number of floor on which Petya lives. Assume that the house is always high enough to fit at least $n$ apartments.

You have to answer $t$ independent test cases.


-----Input-----

The first line of the input contains one integer $t$ ($1 \le t \le 1000$) — the number of test cases. Then $t$ test cases follow.

The only line of the test case contains two integers $n$ and $x$ ($1 \le n, x \le 1000$) — the number of Petya's apartment and the number of apartments on each floor of the house except the first one (there are two apartments on the first floor).


-----Output-----

For each test case, print the answer: the number of floor on which Petya lives.


-----Example-----
Input
4
7 3
1 5
22 5
987 13

Output
3
1
5
77



-----Note-----

Consider the first test case of the example: the first floor contains apartments with numbers $1$ and $2$, the second one contains apartments with numbers $3$, $4$ and $5$, the third one contains apartments with numbers $6$, $7$ and $8$. Therefore, Petya lives on the third floor.

In the second test case of the example, Petya lives in the apartment $1$ which is on the first floor.

Difficulty: introductory

Starter code:

Solutions:
import sys

    
def main():
    #n = iinput()
    #k = iinput() 
    #m = iinput() 
    #n = int(sys.stdin.readline().strip()) 
    #n, k = rinput()
    #n, m = rinput()
    #m, k = rinput()
    #n, k, m = rinput()
    #n, m, k = rinput()
    #k, n, m = rinput()
    #k, m, n = rinput() 
    #m, k, n = rinput()
    #m, n, k = rinput()
    #n, t = map(int, sys.stdin.readline().split())
    #q = list(map(int, sys.stdin.readline().split()))
    #q = linput()
    n, x = list(map(int, sys.stdin.readline().split()))
    if n < 3:
        print(1)
        return 0
    print((n - 2 + x - 1) // x + 1)
    
    
           
        
            
    
    
    
    
    
    
            
                
        
    
            
        

            
        
    
                
    
    
    
            
    
        
    

for i in range(int(sys.stdin.readline().strip()) ):
    main()
    


import sys, math


input = lambda: sys.stdin.readline().rstrip()


def gcd(n, f):
    if n == 0 or f == 0:
        return max(n, f)
    if n > f:
        return gcd(n % f, f)
    else:
        return gcd(f % n, n)


def division_with_remainder_up(pp, ppp):
    return (pp + ppp - 1) // ppp


for i in range(int(input())):
    n, k = map(int, input().split())
    n -= 2
    if n <= 0:
        print(1)
    else:
        print(division_with_remainder_up(n,k)+1)

# Created by: WeirdBugsButOkay
# 28-09-2020, 13:35:28

import math

def solve() :
    n, x = list(map(int, input().split()))
    ans = 1
    n -= 2
    while n > 0 :
        ans += 1
        n -= x
    print(ans)

t = 1
t = int(input())
for _ in range (0, t) :
    solve()


'''
Name : Jaymeet Mehta
codeforces id :mj_13
Problem : 
'''
from sys import stdin,stdout
test=int(stdin.readline())
for _ in range(test):
    n,x = map(int,stdin.readline().split())
    n-=2
    ans=1
    while(n>0):
        n-=x
        ans+=1
    print(ans)

# cook your dish here
# code
#    ___________________________________
#   |                                   |
#   |                                   |
#   |        _,     _   _     ,_        |
#   |    .-'` /     \'-'/     \ `'-.    |
#   |   /    |      |   |      |    \   |
#   |  ;      \_  _/     \_  _/      ;  |
#   | |         ``         ``         | |
#   | |                               | |
#   |  ;    .-.   .-.   .-.   .-.    ;  |
#   |   \  (   '.'   \ /   '.'   )  /   |
#   |    '-.;         V         ;.-'    |
#   |        `                 `        |
#   |                                   |
#   |___________________________________|
#   |                                   |
#   |  Author      :   Ramzz            |
#   |  Created On  :   21-07-2020       |
#   |___________________________________|
#
#    _ __ __ _ _ __ ___  ________
#   | '__/ _` | '_ ` _ \|_  /_  /
#   | | | (_| | | | | | |/ / / / 
#   |_|  \__,_|_| |_| |_/___/___|
#

import math
import collections
from sys import stdin,stdout,setrecursionlimit
from bisect import bisect_left as bsl
from bisect import bisect_right as bsr
import heapq as hq
setrecursionlimit(2**20)

t = 1
t = int(stdin.readline())

for _ in range(t):
    #n = int(stdin.readline())
    #s = stdin.readline().strip('\n')
    n,x = list(map(int, stdin.readline().rstrip().split()))
    
    if(n==1 or n==2):
        print(1)
    else:
        n-=2
        cnt=1
        while(n>0):
            n -= x
            cnt+=1
            
        print(cnt)
    
    
    
    
    


import sys
input = sys.stdin.readline

def getInts():
    return [int(s) for s in input().split()]

def getInt():
    return int(input())

def getStrs():
    return [s for s in input().split()]

def getStr():
    return input().strip()

def listStr():
    return list(input().strip())

import collections as col
import math,itertools

"""
"""

def solve():
    N, X = getInts()
    if N <= 2:
        return 1
    N -= 3
    return N//X + 2
    
#print(solve())
for _ in range(getInt()):
    print(solve())
    


from bisect import bisect_left as bl
from bisect import bisect_right as br
from heapq import heappush,heappop,heapify
import math
from collections import *
from functools import reduce,cmp_to_key
import sys
input = sys.stdin.readline

from itertools import accumulate
from functools import lru_cache

M = mod = 998244353
def factors(n):return sorted(set(reduce(list.__add__, ([i, n//i] for i in range(1, int(n**0.5) + 1) if n % i == 0))))
def inv_mod(n):return pow(n, mod - 2, mod)
 
def li():return [int(i) for i in input().rstrip('\n').split()]
def st():return input().rstrip('\n')
def val():return int(input().rstrip('\n'))
def li2():return [i for i in input().rstrip('\n')]
def li3():return [int(i) for i in input().rstrip('\n')]


for _ in range(val()):
    n, x = li()
    if n <= 2:
        print(1)
    else:
        n -= 2
        print(1 + (n // x) + (1 if n % x else 0))

from math import *
for _ in range(int(input())):
    n, x = list(map(int, input().split()))
    if n <= 2:
        print(1)
    else:
        print(1 + (n - 2 + x - 1) // x)

for _ in range(int(input())):
    n, x = tuple(map(int, input().split()))
    if n <= 2:
        print(1)
    else:
        print((n - 3) // x + 2)


'''
    Auther: ghoshashis545 Ashis Ghosh
    College: jalpaiguri Govt Enggineering College

'''
from os import path
import sys
from heapq import heappush,heappop
from functools import cmp_to_key as ctk
from collections import deque,defaultdict as dd
from bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right
from itertools import permutations
from datetime import datetime
from math import ceil,sqrt,log,gcd
def ii():return int(input())
def si():return input().rstrip()
def mi():return map(int,input().split())
def li():return list(mi())
abc='abcdefghijklmnopqrstuvwxyz'
# mod=1000000007
mod=998244353
inf = float("inf")
vow=['a','e','i','o','u']
dx,dy=[-1,1,0,0],[0,0,1,-1]

def bo(i):
    return ord(i)-ord('a')



    
def solve():

    
    
    
    for _ in range(ii()):

        n,x = mi()
        if n<=2:
            print(1)
            continue

        c = 2
        p = 2+x
        while(n > p):
            p += x
            c += 1
        print(c) 















    



        
def __starting_point():

    
    if path.exists('input.txt'):
        sys.stdin=open('input.txt', 'r')
        sys.stdout=open('output.txt','w')
    else:
        input=sys.stdin.readline
    solve()
__starting_point()

def ii(): return int(input())
def li(): return list(map(int, input().split()))


t = int(input())

for _ in range(t):
    n, x = list(map(int, input().split()))

    for i in range(n):
        if i*x+2 >= n:
            print(i+1)
            break


for _ in range(int(input())):
	n, x = list(map(int, input().split()))
	l = 1
	r = 2
	cnt = 1
	while True:
		if l <= n <= r:
			print(cnt)
			break
		else:
			cnt+=1
			l = r + 1
			r += x


for _ in range(int(input())):
    n, x = list(map(int, input().split()))
    if n <= 2:
        print(1)
    else:
        if (n - 2) % x == 0:
            print((n - 2) // x + 1)
        else:
            print((n - 2) // x + 2)


import math
import collections
t=int(input())
for w in range(t):
    n,x=(int(i) for i in input().split())
    if(n<=2):
        print(1)
    else:
        print(1+math.ceil((n-2)/x))

import math
for _ in range(int(input())):
    x,y=map(int,input().split())
    if x<3:
        print(1)
    else:
        x-=2
        x=math.ceil(x/y)
        print(x+1)

# for _ in range(1):
for _ in range(int(input())):
    # n = int(input())
    n, x = list(map(int, input().split()))
    # arr = list(map(int, input().split()))
    # s = input()
    if (n <= 2):
        print(1)
    else:
        n -= 3
        print(n // x + 2)


import sys
import re
import random
import math
import copy
from heapq import heappush, heappop, heapify
from functools import cmp_to_key
from bisect import bisect_left, bisect_right
from collections import defaultdict, deque, Counter
# sys.setrecursionlimit(1000000)

# input aliases
input = sys.stdin.readline
getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = float("inf")
MOD = 10**9 + 7
divide = lambda x: pow(x, MOD-2, MOD)

def solve():
    n, m = getList()
    if n <= 2:
        print(1)
        return
    else:
        f = (n-3) // m
        print(f + 2)


def main():
    n = getN()
    for _ in range(n):
        solve()

    return
def __starting_point():
    main()
    # solve()

__starting_point()

import sys
input=sys.stdin.readline

T=int(input())
for _ in range(T):
    #n=int(input())
    n,x=list(map(int,input().split()))
    #A=list(map(int,input().split()))

    flag=1
    for i in range(2,n,x):
        flag=flag+1

    print(flag)


t = int(input())
while t:
    t -= 1
    n, x = list(map(int, input().split()))
    ans = 1
    total = 2
    if n <= 2:
        print(1)
        continue
    while True:
        total += x
        ans += 1
        if total >= n:
            print(ans)
            break


from collections import *
from heapq import *
from math import *


t = int(input())
while t:
    t -= 1
    # n = int(input())
    n,x =[int(x) for x in input().split()]
    if n <= 2:
        print(1)
    else:
        n -= 2
        print(1+ceil(n/x))

# if graph problem, dont forget to write sys.setrecursionlimit(10**7)
from math import ceil, floor


def solve():

    n, x = list(map(int, input().split()))
    if (1 <= n <= 2):
        print(1)
    else:
        print(ceil((n-2)/x)+1)
    return


def main():
    T = int(input())
    for i in range(T):
        solve()
    return


def __starting_point():
    main()


__starting_point()

for _ in range (int(input())):
    a,b=map(int,input().split())
    if(a<=2):
        print(1)
    else:
        a-=2
        ans=1
        if(a%b!=0):ans=2
        ans+=a//b
        print(ans)

from sys import stdin, stdout
input = stdin.readline
from collections import defaultdict as dd
import math
def geti(): return list(map(int, input().strip().split()))
def getl(): return list(map(int, input().strip().split()))
def gets(): return input()
def geta(): return int(input())
def print_s(s): stdout.write(s+'\n')

def solve():
    for _ in range(geta()):
        n,k=geti()
        n-=2
        ans=1
        while n>0:
            ans+=1
            n-=k
        print(ans)

def __starting_point():
    solve()

__starting_point()

for i in range(int(input())):
    n,x=list(map(int,input().split()))
    ans=2
    v=1
    if n<=2:
        print(1)
    else:
        for i in range(n-2):
            v+=1
            ans+=x
            if ans>=n:
                print(v)
                break


import math
from collections import deque
from collections import defaultdict

t = int(input())
while t>0:
    t-=1
    n,x = list(map(int,input().strip().split(" ")))
    
    if n==1 or n==2:
        print(1)
    else:
        n -= 2
        
        print(math.ceil(n/x)+ 1)