There are $N$ cells numbered 1,2,….., N, and every cell has some positive value. you will be given an array $A_1$,$A_2$,…,$A_N$ where $A_i$ is the value of $ith$ cell and an integer $K$.
There is a monkey who wants to reach the $right$ side of the last ($Nth$) cell, initially, the monkey was left side of the first ($1st$) cell. 
In the first step, he can jump into any cell numbered 1,2,….., K.Once he jumped into any cell $i$ next he can only jump to the cell $j$ such that-
- j>i
- j-i <= K  
- A[i]%2 == A[j]%2
You have to find out what is the minimum number of steps required to reach the right side of the cell or In case it's not possible to reach the right side of the cell your answer should be $-1$.NOTE: As soon as monkey reach any cell whose distance from the last cell is less than K, then in the last step, he will jump out to the right side of the ($Nth$) cell.

-----Input:-----
- First-line will contain $T$, the number of test cases. Then the test cases follow. 
- The first line of each test case contains two space-separated integers $N$ and $K$.
- The second line contains $N$ space-separated integers $A_1$,$A_2$,…,$A_N$

-----Output:-----
For each test case, output in a single line minimum steps or $-1$.

-----Constraints-----
- $1 \leq T \leq 100$
- $1 \leq N \leq 2*10^5$
- $1 \leq K \leq N$
- $0 \leq A_i \leq 10^6$
- $\text{the sum of N over all test cases does not exceed $5*10^{5}$}$

-----Sample Input:-----
1
2 2
3 4

-----Sample Output:-----
2 

-----EXPLANATION:-----
in the first step, you can jump into any cell 1 or 2 and then in the second step you will jump 
out to the right side of 2nd cell
remember we don't want to reach $Nth$ cell we want to reach the right side of the nth cell.

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = "import sys\r\n# sys.stdin = open('input.txt', 'r') \r\n# sys.stdout = open('output.txt', 'w')\r\n \r\nimport math\r\nimport collections\r\nfrom sys import stdin,stdout,setrecursionlimit\r\nimport bisect as bs\r\nsetrecursionlimit(2**20)\r\nM = 10**9+7\r\n    \r\nT = int(stdin.readline())\r\n# T = 1\r\n\r\nfor _ in range(T):\r\n    # n = int(stdin.readline())\r\n    n,k = list(map(int,stdin.readline().split()))\r\n    a = list(map(int,stdin.readline().split()))\r\n    # w = list(map(int,stdin.readline().split()))\r\n    # q = list(map(int,stdin.readline().split()))\r\n    # b = list(map(int,stdin.readline().split()))\r\n    # s = stdin.readline().strip('\\n')\r\n    p = [[0]]; p.append([0])\r\n    for i in range(n):\r\n        p[a[i]%2].append(i+1)\r\n    p[0].append(n+1); p[1].append(n+1)\r\n    res = [True, True]\r\n    for j in range(2):\r\n        for i in range(len(p[j])-1):\r\n            if(p[j][i+1] - p[j][i] > k):\r\n                res[j] = False\r\n                break\r\n    mn = 500000\r\n    for j in range(2):\r\n        if(not res[j]):\r\n            continue\r\n        i = 1; s = 0; m=0\r\n        while(i<len(p[j])):\r\n            if(p[j][i]-s > k):\r\n                s = p[j][i-1]\r\n                m += 1\r\n            else:\r\n                i += 1\r\n        m += 1\r\n        mn = min(mn,m)\r\n    if(mn == 500000):\r\n        print(-1)\r\n    else:\r\n        print(mn)"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13985