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.
[{"code": "import sys\n\n    \ndef main():\n    #n = iinput()\n    #k = iinput() \n    #m = iinput() \n    #n = int(sys.stdin.readline().strip()) \n    #n, k = rinput()\n    #n, m = rinput()\n    #m, k = rinput()\n    #n, k, m = rinput()\n    #n, m, k = rinput()\n    #k, n, m = rinput()\n    #k, m, n = rinput() \n    #m, k, n = rinput()\n    #m, n, k = rinput()\n    #n, t = map(int, sys.stdin.readline().split())\n    #q = list(map(int, sys.stdin.readline().split()))\n    #q = linput()\n    n, x = list(map(int, sys.stdin.readline().split()))\n    if n < 3:\n        print(1)\n        return 0\n    print((n - 2 + x - 1) // x + 1)\n    \n    \n           \n        \n            \n    \n    \n    \n    \n    \n    \n            \n                \n        \n    \n            \n        \n\n            \n        \n    \n                \n    \n    \n    \n            \n    \n        \n    \n\nfor i in range(int(sys.stdin.readline().strip()) ):\n    main()\n    \n", "passed": true, "time": 0.15, "memory": 14216.0, "status": "done"}, {"code": "import sys, math\n\n\ninput = lambda: sys.stdin.readline().rstrip()\n\n\ndef gcd(n, f):\n    if n == 0 or f == 0:\n        return max(n, f)\n    if n > f:\n        return gcd(n % f, f)\n    else:\n        return gcd(f % n, n)\n\n\ndef division_with_remainder_up(pp, ppp):\n    return (pp + ppp - 1) // ppp\n\n\nfor i in range(int(input())):\n    n, k = map(int, input().split())\n    n -= 2\n    if n <= 0:\n        print(1)\n    else:\n        print(division_with_remainder_up(n,k)+1)", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "# Created by: WeirdBugsButOkay\n# 28-09-2020, 13:35:28\n\nimport math\n\ndef solve() :\n    n, x = list(map(int, input().split()))\n    ans = 1\n    n -= 2\n    while n > 0 :\n        ans += 1\n        n -= x\n    print(ans)\n\nt = 1\nt = int(input())\nfor _ in range (0, t) :\n    solve()\n", "passed": true, "time": 0.14, "memory": 14124.0, "status": "done"}, {"code": "'''\nName : Jaymeet Mehta\ncodeforces id :mj_13\nProblem : \n'''\nfrom sys import stdin,stdout\ntest=int(stdin.readline())\nfor _ in range(test):\n    n,x = map(int,stdin.readline().split())\n    n-=2\n    ans=1\n    while(n>0):\n        n-=x\n        ans+=1\n    print(ans)", "passed": true, "time": 0.16, "memory": 14160.0, "status": "done"}, {"code": "# cook your dish here\n# code\n#    ___________________________________\n#   |                                   |\n#   |                                   |\n#   |        _,     _   _     ,_        |\n#   |    .-'` /     \\'-'/     \\ `'-.    |\n#   |   /    |      |   |      |    \\   |\n#   |  ;      \\_  _/     \\_  _/      ;  |\n#   | |         ``         ``         | |\n#   | |                               | |\n#   |  ;    .-.   .-.   .-.   .-.    ;  |\n#   |   \\  (   '.'   \\ /   '.'   )  /   |\n#   |    '-.;         V         ;.-'    |\n#   |        `                 `        |\n#   |                                   |\n#   |___________________________________|\n#   |                                   |\n#   |  Author      :   Ramzz            |\n#   |  Created On  :   21-07-2020       |\n#   |___________________________________|\n#\n#    _ __ __ _ _ __ ___  ________\n#   | '__/ _` | '_ ` _ \\|_  /_  /\n#   | | | (_| | | | | | |/ / / / \n#   |_|  \\__,_|_| |_| |_/___/___|\n#\n\nimport math\nimport collections\nfrom sys import stdin,stdout,setrecursionlimit\nfrom bisect import bisect_left as bsl\nfrom bisect import bisect_right as bsr\nimport heapq as hq\nsetrecursionlimit(2**20)\n\nt = 1\nt = int(stdin.readline())\n\nfor _ in range(t):\n    #n = int(stdin.readline())\n    #s = stdin.readline().strip('\\n')\n    n,x = list(map(int, stdin.readline().rstrip().split()))\n    \n    if(n==1 or n==2):\n        print(1)\n    else:\n        n-=2\n        cnt=1\n        while(n>0):\n            n -= x\n            cnt+=1\n            \n        print(cnt)\n    \n    \n    \n    \n    \n", "passed": true, "time": 0.89, "memory": 14200.0, "status": "done"}, {"code": "import sys\ninput = sys.stdin.readline\n\ndef getInts():\n    return [int(s) for s in input().split()]\n\ndef getInt():\n    return int(input())\n\ndef getStrs():\n    return [s for s in input().split()]\n\ndef getStr():\n    return input().strip()\n\ndef listStr():\n    return list(input().strip())\n\nimport collections as col\nimport math,itertools\n\n\"\"\"\n\"\"\"\n\ndef solve():\n    N, X = getInts()\n    if N <= 2:\n        return 1\n    N -= 3\n    return N//X + 2\n    \n#print(solve())\nfor _ in range(getInt()):\n    print(solve())\n    \n", "passed": true, "time": 0.15, "memory": 14052.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    n, x = tuple(map(int, input().split()))\n    if n <= 2:\n        print(1)\n    else:\n        print((n - 3) // x + 2)\n", "passed": true, "time": 0.16, "memory": 14232.0, "status": "done"}, {"code": "'''\n    Auther: ghoshashis545 Ashis Ghosh\n    College: jalpaiguri Govt Enggineering College\n\n'''\nfrom os import path\nimport sys\nfrom heapq import heappush,heappop\nfrom functools import cmp_to_key as ctk\nfrom collections import deque,defaultdict as dd\nfrom bisect import bisect,bisect_left,bisect_right,insort,insort_left,insort_right\nfrom itertools import permutations\nfrom datetime import datetime\nfrom math import ceil,sqrt,log,gcd\ndef ii():return int(input())\ndef si():return input().rstrip()\ndef mi():return map(int,input().split())\ndef li():return list(mi())\nabc='abcdefghijklmnopqrstuvwxyz'\n# mod=1000000007\nmod=998244353\ninf = float(\"inf\")\nvow=['a','e','i','o','u']\ndx,dy=[-1,1,0,0],[0,0,1,-1]\n\ndef bo(i):\n    return ord(i)-ord('a')\n\n\n\n    \ndef solve():\n\n    \n    \n    \n    for _ in range(ii()):\n\n        n,x = mi()\n        if n<=2:\n            print(1)\n            continue\n\n        c = 2\n        p = 2+x\n        while(n > p):\n            p += x\n            c += 1\n        print(c) \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n    \n\n\n\n        \ndef __starting_point():\n\n    \n    if path.exists('input.txt'):\n        sys.stdin=open('input.txt', 'r')\n        sys.stdout=open('output.txt','w')\n    else:\n        input=sys.stdin.readline\n    solve()\n__starting_point()", "passed": true, "time": 0.15, "memory": 16728.0, "status": "done"}, {"code": "def ii(): return int(input())\ndef li(): return list(map(int, input().split()))\n\n\nt = int(input())\n\nfor _ in range(t):\n    n, x = list(map(int, input().split()))\n\n    for i in range(n):\n        if i*x+2 >= n:\n            print(i+1)\n            break\n", "passed": true, "time": 0.14, "memory": 14240.0, "status": "done"}, {"code": "for _ in range(int(input())):\n\tn, x = list(map(int, input().split()))\n\tl = 1\n\tr = 2\n\tcnt = 1\n\twhile True:\n\t\tif l <= n <= r:\n\t\t\tprint(cnt)\n\t\t\tbreak\n\t\telse:\n\t\t\tcnt+=1\n\t\t\tl = r + 1\n\t\t\tr += x\n", "passed": true, "time": 0.17, "memory": 14104.0, "status": "done"}, {"code": "for _ in range(int(input())):\n    n, x = list(map(int, input().split()))\n    if n <= 2:\n        print(1)\n    else:\n        if (n - 2) % x == 0:\n            print((n - 2) // x + 1)\n        else:\n            print((n - 2) // x + 2)\n", "passed": true, "time": 0.14, "memory": 14200.0, "status": "done"}, {"code": "import math\nimport collections\nt=int(input())\nfor w in range(t):\n    n,x=(int(i) for i in input().split())\n    if(n<=2):\n        print(1)\n    else:\n        print(1+math.ceil((n-2)/x))", "passed": true, "time": 0.15, "memory": 14072.0, "status": "done"}, {"code": "import math\nfor _ in range(int(input())):\n    x,y=map(int,input().split())\n    if x<3:\n        print(1)\n    else:\n        x-=2\n        x=math.ceil(x/y)\n        print(x+1)", "passed": true, "time": 0.23, "memory": 14324.0, "status": "done"}, {"code": "# for _ in range(1):\nfor _ in range(int(input())):\n    # n = int(input())\n    n, x = list(map(int, input().split()))\n    # arr = list(map(int, input().split()))\n    # s = input()\n    if (n <= 2):\n        print(1)\n    else:\n        n -= 3\n        print(n // x + 2)\n", "passed": true, "time": 0.14, "memory": 14304.0, "status": "done"}, {"code": "import sys\nimport re\nimport random\nimport math\nimport copy\nfrom heapq import heappush, heappop, heapify\nfrom functools import cmp_to_key\nfrom bisect import bisect_left, bisect_right\nfrom collections import defaultdict, deque, Counter\n# sys.setrecursionlimit(1000000)\n\n# input aliases\ninput = sys.stdin.readline\ngetS = lambda: input().strip()\ngetN = lambda: int(input())\ngetList = lambda: list(map(int, input().split()))\ngetZList = lambda: [int(x) - 1 for x in input().split()]\n\nINF = float(\"inf\")\nMOD = 10**9 + 7\ndivide = lambda x: pow(x, MOD-2, MOD)\n\ndef solve():\n    n, m = getList()\n    if n <= 2:\n        print(1)\n        return\n    else:\n        f = (n-3) // m\n        print(f + 2)\n\n\ndef main():\n    n = getN()\n    for _ in range(n):\n        solve()\n\n    return\ndef __starting_point():\n    main()\n    # solve()\n\n__starting_point()", "passed": true, "time": 0.25, "memory": 14260.0, "status": "done"}, {"code": "import sys\ninput=sys.stdin.readline\n\nT=int(input())\nfor _ in range(T):\n    #n=int(input())\n    n,x=list(map(int,input().split()))\n    #A=list(map(int,input().split()))\n\n    flag=1\n    for i in range(2,n,x):\n        flag=flag+1\n\n    print(flag)\n", "passed": true, "time": 0.14, "memory": 14232.0, "status": "done"}, {"code": "t = int(input())\nwhile t:\n    t -= 1\n    n, x = list(map(int, input().split()))\n    ans = 1\n    total = 2\n    if n <= 2:\n        print(1)\n        continue\n    while True:\n        total += x\n        ans += 1\n        if total >= n:\n            print(ans)\n            break\n", "passed": true, "time": 0.14, "memory": 14044.0, "status": "done"}, {"code": "# if graph problem, dont forget to write sys.setrecursionlimit(10**7)\nfrom math import ceil, floor\n\n\ndef solve():\n\n    n, x = list(map(int, input().split()))\n    if (1 <= n <= 2):\n        print(1)\n    else:\n        print(ceil((n-2)/x)+1)\n    return\n\n\ndef main():\n    T = int(input())\n    for i in range(T):\n        solve()\n    return\n\n\ndef __starting_point():\n    main()\n\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14120.0, "status": "done"}, {"code": "for _ in range (int(input())):\n    a,b=map(int,input().split())\n    if(a<=2):\n        print(1)\n    else:\n        a-=2\n        ans=1\n        if(a%b!=0):ans=2\n        ans+=a//b\n        print(ans)", "passed": true, "time": 0.14, "memory": 14216.0, "status": "done"}, {"code": "from sys import stdin, stdout\ninput = stdin.readline\nfrom collections import defaultdict as dd\nimport math\ndef geti(): return list(map(int, input().strip().split()))\ndef getl(): return list(map(int, input().strip().split()))\ndef gets(): return input()\ndef geta(): return int(input())\ndef print_s(s): stdout.write(s+'\\n')\n\ndef solve():\n    for _ in range(geta()):\n        n,k=geti()\n        n-=2\n        ans=1\n        while n>0:\n            ans+=1\n            n-=k\n        print(ans)\n\ndef __starting_point():\n    solve()\n\n__starting_point()", "passed": true, "time": 0.14, "memory": 14400.0, "status": "done"}, {"code": "for i in range(int(input())):\n    n,x=list(map(int,input().split()))\n    ans=2\n    v=1\n    if n<=2:\n        print(1)\n    else:\n        for i in range(n-2):\n            v+=1\n            ans+=x\n            if ans>=n:\n                print(v)\n                break\n", "passed": true, "time": 0.14, "memory": 14140.0, "status": "done"}, {"code": "import math\nfrom collections import deque\nfrom collections import defaultdict\n\nt = int(input())\nwhile t>0:\n    t-=1\n    n,x = list(map(int,input().strip().split(\" \")))\n    \n    if n==1 or n==2:\n        print(1)\n    else:\n        n -= 2\n        \n        print(math.ceil(n/x)+ 1)\n", "passed": true, "time": 0.14, "memory": 14084.0, "status": "done"}]