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 = '# cook your dish here\n#2\n\nfor t in range(int(input())):\n    n, k = list(map(int, input().split()))\n    A = list(map(int, input().split()))\n\n    if k > n:\n        print(1)\n        continue\n    #even \n    curr = -1\n    i = 0\n    temp_even_place = -1\n    ans_of_even = 0\n    while curr + k < n: #need to find a stop \n        while i-curr <= k:\n            if A[i]%2 == 0:\n                temp_even_place = i\n            i+=1\n        if temp_even_place == curr: #no new stop found\n            ans_of_even = -1\n            break\n        else:\n            ans_of_even += 1\n            curr = temp_even_place\n    if ans_of_even != -1:\n        ans_of_even += 1\n\n    #odd \n    curr = -1\n    i = 0\n    temp_odd_place = -1\n    ans_of_odd = 0\n    while curr + k < n: #need to find a stop \n        while i-curr <= k:\n            if A[i]%2 == 1:\n                temp_odd_place = i\n            i+=1\n        if temp_odd_place == curr: #no new stop found\n            ans_of_odd = -1\n            break\n        else:\n            ans_of_odd += 1\n            curr = temp_odd_place\n    if ans_of_odd != -1:\n        ans_of_odd += 1\n\n    if ans_of_even == -1 and ans_of_odd == -1:\n        print(-1)\n    elif ans_of_odd == -1 and ans_of_even != -1:\n        print(ans_of_even)\n    elif ans_of_odd != -1 and ans_of_even == -1:\n        print(ans_of_odd)\n    elif ans_of_odd != -1 and ans_of_even != -1:\n        print(min(ans_of_even,ans_of_odd) )\n    \n    \n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13623