You are given a non-decreasing array of non-negative integers $a_1, a_2, \ldots, a_n$. Also you are given a positive integer $k$.

You want to find $m$ non-decreasing arrays of non-negative integers $b_1, b_2, \ldots, b_m$, such that:  The size of $b_i$ is equal to $n$ for all $1 \leq i \leq m$.  For all $1 \leq j \leq n$, $a_j = b_{1, j} + b_{2, j} + \ldots + b_{m, j}$. In the other word, array $a$ is the sum of arrays $b_i$.  The number of different elements in the array $b_i$ is at most $k$ for all $1 \leq i \leq m$. 

Find the minimum possible value of $m$, or report that there is no possible $m$.


-----Input-----

The first line contains one integer $t$ ($1 \leq t \leq 100$): the number of test cases.

The first line of each test case contains two integers $n$, $k$ ($1 \leq n \leq 100$, $1 \leq k \leq n$).

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($0 \leq a_1 \leq a_2 \leq \ldots \leq a_n \leq 100$, $a_n > 0$).


-----Output-----

For each test case print a single integer: the minimum possible value of $m$. If there is no such $m$, print $-1$.


-----Example-----
Input
6
4 1
0 0 0 1
3 1
3 3 3
11 3
0 1 2 2 3 3 3 4 4 4 4
5 3
1 2 3 4 5
9 4
2 2 3 5 7 11 13 13 17
10 7
0 1 1 2 3 3 4 5 5 6

Output
-1
1
2
2
2
1



-----Note-----

In the first test case, there is no possible $m$, because all elements of all arrays should be equal to $0$. But in this case, it is impossible to get $a_4 = 1$ as the sum of zeros.

In the second test case, we can take $b_1 = [3, 3, 3]$. $1$ is the smallest possible value of $m$.

In the third test case, we can take $b_1 = [0, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2]$ and $b_2 = [0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2]$. It's easy to see, that $a_i = b_{1, i} + b_{2, i}$ for all $i$ and the number of different elements in $b_1$ and in $b_2$ is equal to $3$ (so it is at most $3$). It can be proven that $2$ is the smallest possible value of $m$.

Difficulty: interview

Starter code:

Solutions:

t=int(input())
for nbt in range(t):
    n,k=[int(i) for i in input().split()]
    a=[int(i) for i in input().split()]
    nbc=len(set(a))-1
    if k==1:
        if nbc:
            print(-1)
        else:
            print(1)
    else:
        print(1+max(0,(nbc-1)//(k-1)))

y=lambda:[*map(int,input().split())]
for _ in range(int(input())):
    n,k=map(int,input().split())
    a=y()
    b=len(set(a))
    if k<2:print(1-2*(b>1))
    else:print(max(1,-((1-b)//(k-1))))

from math import ceil


def main(n, k, a):
    a = set(a)
    n = len(a)
    if n > k == 1:
        return -1
    if n <= k:
        return 1
    return 1 + ceil((n-k)/(k-1))


for i in range(int(input())):
    n, k = list(map(int, input().split()))
    a = list(map(int, input().split()))
    print(main(n, k, a))


import sys,math
from collections import Counter,deque,defaultdict
from bisect import bisect_left,bisect_right 
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

for _ in range(inp()):
    n,k = inpl()
    a = inpl()
    ln = len(set(a))
    if k == 1 and ln > 1:
        print(-1)
        continue
    if ln == 1:
        print(1)
        continue
    ln -= 1
    k -= 1
    print((ln+k-1)//k)


"""

"""

from sys import stdin

def updiv(a,b):
    if a % b == 0:
        return a // b
    else:
        return a//b+1

tt = int(stdin.readline())

for loop in range(tt):

    n,k = list(map(int,stdin.readline().split()))
    a = list(map(int,stdin.readline().split()))

    num = 0
    
    for i in range(n):
        if i == 0:
            num += 1
        elif a[i] != a[i-1]:
            num += 1

    if k == 1:
        if num == 1:
            print(1)
        else:
            print(-1)
        continue

    elif num <= k:
        print(1)
        continue

    num -= k
    print(updiv(num,k-1) + 1)
            
    


t=int(input())
for you in range(t):
    l=input().split()
    n=int(l[0])
    k=int(l[1])
    l=input().split()
    li=[int(i) for i in l]
    if(k==1):
        poss=1
        for i in li:
            if(i!=li[0]):
                poss=0
                break
        if(poss):
            print(1)
        else:
            print(-1)
        continue
    count=0
    for i in range(n-1):
        if(li[i]!=li[i+1]):
            count+=1
    count+=1
    for i in range(1,400):
        if((i-1)*(k-1)+k>=count):
            ans=i
            break
    print(ans)


t = int(input())
for _ in range(t):
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    ans=1
    for i in range(n-1):
        if a[i+1]>a[i]:
            ans+=1
    if ans<=k:
        print(1)
    elif k==1:
        print(-1)
    else:
        print((ans-k-1)//(k-1)+2)

from collections import defaultdict 
import sys
import math 	

def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

for _ in range(int(input())):
	(n,k) = get_ints()
	a = get_array()
	if len(set(a)) <= k:
		print(1)
		continue
	if k==1:
		print(-1)
		continue
	
	l = len(set(a))
	ans = 1 
	l-=k 
	while(l>0):
		l-=(k-1)
		ans+=1
	print(ans)

import sys
readline = sys.stdin.readline

T = int(readline())
Ans = [None]*T

for qu in range(T):
    N, K = list(map(int, readline().split()))
    A = list(map(int, readline().split()))
    if K == 1:
        if len(set(A)) == 1:
            Ans[qu] = 1
        else:
            Ans[qu] = -1
    else:
        s = len(set(A))        
        if K >= s:
            Ans[qu] = 1
        else:
            Ans[qu] = 1-((K-s)//(K-1))

print('\n'.join(map(str, Ans)))


from bisect import *
from collections import *
from math import *
from heapq import *
from typing import List
from itertools import *
from operator import *
from functools import *
import sys
'''
@lru_cache(None)
def fact(x):
    if x<2:
        return 1
    return fact(x-1)*x

@lru_cache(None)
def per(i,j):
    return fact(i)//fact(i-j)

@lru_cache(None)
def com(i,j):
    return per(i,j)//fact(j)

def linc(f,t,l,r):
    while l<r:
        mid=(l+r)//2
        if t>f(mid):
            l=mid+1
        else:
            r=mid
    return l

def rinc(f,t,l,r):
    while l<r:
        mid=(l+r+1)//2
        if t<f(mid):
            r=mid-1
        else:
            l=mid
    return l

def ldec(f,t,l,r):
    while l<r:
        mid=(l+r)//2
        if t<f(mid):
            l=mid+1
        else:
            r=mid
    return l

def rdec(f,t,l,r):
    while l<r:
        mid=(l+r+1)//2
        if t>f(mid):
            r=mid-1
        else:
            l=mid
    return l

def isprime(n):
    for i in range(2,int(n**0.5)+1):
        if n%i==0:
            return False
    return True

def power2(n):
    while not n&1:
        n>>=1
    return n==1
'''
'''
import time
s=time.time()
e=time.time()
print(e-s)
'''

t=int(input())
for i in range(t):
    n,k=list(map(int,input().split()))
    #n=int(input())
    a=set(map(int,input().split()))
    n=len(a)
    if n==1:
        ans=1
    else:
        if k==1:
            ans=-1
        else:
            ans=ceil((n-1)/(k-1))
    print(ans)
'''
n,m=map(int,input().split())
graph=defaultdict(dict)
for i in range(m):
    u,v,w=map(int,input().split())
    graph[u][v]=w
    graph[v][u]=w
def dij(u,v):
    graph[u][v]*=2
    graph[v][u]*=2
    d={}
    d[1]=0
    for i in range(2,n+1):
        d[i]=inf
    remain=set(range(2,n+1))
    for i in graph[1]:
        d[i]=graph[1][i]
    while remain:
        k=min(remain,key=lambda x: d[x])
        remain.remove(k)
        for i in remain:
            if i in graph[k]:
                d[i]=min(d[i],d[k]+graph[k][i])
    graph[u][v]//=2
    graph[v][u]//=2
    return d[n]
D={}
D[1]=0
for i in range(2,n+1):
    D[i]=inf
remain=set(range(2,n+1))
pre=[-1]*(n+1)
for i in graph[1]:
    D[i]=graph[1][i]
    pre[i]=1
while remain:
    k=min(remain,key=lambda x: D[x])
    remain.remove(k)
    for i in remain:
        if i in graph[k]:
            if D[i]>D[k]+graph[k][i]:
                D[i]=D[k]+graph[k][i]
                pre[i]=k
cur=ans=D[n]
node=n
while pre[node]!=-1:
    ans=max(ans,dij(node,pre[node]))
    node=pre[node]
print(ans-cur)
            
'''
    



def is_sorted(li):
    temp=list(li)
    for i in range(0,len(li)):
        if(li[i]!=temp[i]):
            return False
    return True


def process():
    n,k=list(map(int,input().split()))
    li=list(map(int,input().split()))
    if(is_sorted(li)==False):
        print("-1")
        return
    elif(k==1 and len(set(li))==1):
        print("1")
        return
    elif(k>1):
        ans=0
        s=len(set(li))
        ans=1
        s-=k
        while(s>0):
            ans+=1
            s-=k-1
        print(ans)
    else:
        print("-1")
        return

tests=int(input())
for i in range(tests):
    process()

gans = []
for _ in range(int(input())):
    n, k = list(map(int, input().split()))
    a = list(map(int, input().split()))
    u = []
    for i in range(1, n):
        if a[i] == a[i - 1]:
            continue
        u.append(a[i - 1])
    u.append(a[-1])
    if len(u) > 1 and k == 1:
        ans = -1
    elif k == 1:
        ans = 1
    elif len(u) == 1:
        ans = 1
    else:
        ans = (max(len(u) - 1 - 1, 0)) // (k - 1) + 1
    gans.append(ans)
print('\n'.join(map(str, gans)))


#   ==========     //\\       //||     ||====//||
#       ||        //  \\        ||     ||   // ||
#       ||       //====\\       ||     ||  //  ||
#       ||      //      \\      ||     || //   ||
#   ========== //        \\  ========  ||//====|| 
#  code

def solve():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))

    if n == 1:
        print(1)
        return
    
    diff = 1
    ans = 1
    for i, v in enumerate(a):
        if i > 0:
            if v == a[i - 1]:
                continue
            else:
                diff += 1
                if diff > k:
                    ans += 1
                    diff = 2
    
    if diff > k:
        print(-1)
    else:
        print(ans)
    return

def main():
    t = 1
    t = int(input())
    for _ in range(t):
        solve()

def __starting_point():
    main()
__starting_point()

import sys
# sys.stdin = open("input.txt")


def main():
    T = int(input())
    for ti in range(T):
        n, k = list(map(int, input().split()))
        A = set(int(v) for v in input().split())
        if k == 1:
            if len(A) == 1:
                print(1)
            else:
                print(-1)
            continue
        if len(A) == 1:
            print(1)
        else:
            print((len(A) - 3 + k) // (k - 1))


def __starting_point():
    main()

__starting_point()