Winter is coming. In a land far away, N men are spending the nights in a valley in a largest field. The valley is so narrow that it can be considered to be a straight line running east-to-west.
Although standing in the valley does shield them from the wind, the group still shivers during the cold nights. They, like anyone else, would like to gather together for warmth.
Near the end of each day, each man i finds himself somewhere in the valley at a unique location Li. The men want to gather into groups of three or more persons since two persons just aren't warm enough. They want to be in groups before sunset, so the distance K each man can walk to form a group is limited. Determine the smallest number of groups the men can form.
Input
Input starts with an integer T (≤ 15), denoting the number of test cases.
Each case starts with two integers N (1 ≤ N ≤ 105) and K (1 ≤ K ≤ 106). Each of the next N line contains an integer Li (1 ≤ Li ≤ 108).
Output
For each case, print the case number and smallest number of groups the men can gather into. If there is no way for all the men to gather into groups of at least size three, output -1.
Sample
Sample Input | Sample Output |
---|---|
2 6 10 2 10 15 13 28 9 3 1 1 10 20 | Case 1: 2 Case 2: -1 |
Notes
Dataset is huge, use faster I/O methods.