You are given a non-decreasing array of positive integers, ‘NUMS’, and provided with an integer ‘K’. Your take is to find out whether it is possible to divide ‘NUMS’ into increasing subsequences such that each of their lengths is at least ‘K’.
Input Format:
The first line contains an integer ‘T’, which denotes the number of test cases to be run. Then, the ‘T’ test cases follow.
The first line of each test case contains two positive integers, ‘N’ denoting the size of the array ‘NUMS’ and ‘K’.
The second line of each test case contains ‘N’ space-separated positive integers denoting the array elements.
Output Format:
For each test case, print ‘YES’ if it is possible to create the required subsequences, otherwise print ‘NO’.
The output of each test case will be printed in a separate line.
Note:
You do not need to print anything. It has already been taken care of. Just implement the given function.
Constraints:
1 <= ‘T’ <= 10
1 <= ‘N’ <= 10^6
1 <= ‘K’ <= ‘N’
1 <= ‘NUMS[i]’ <= 10^6
Where ‘NUMS[i]’ is the i-th element of the array ‘NUMS’.
Time Limit: 1 sec