#P1992F. Valuable Cards
Valuable Cards
No submission language available for this problem.
Description
In his favorite cafe Kmes once again wanted to try the herring under a fur coat. Previously, it would not have been difficult for him to do this, but the cafe recently introduced a new purchasing policy.
Now, in order to make a purchase, Kmes needs to solve the following problem: cards with prices for different positions are laid out in front of him, on the -th card there is an integer , among these prices there is no whole positive integer .
Kmes is asked to divide these cards into the minimum number of bad segments (so that each card belongs to exactly one segment). A segment is considered bad if it is impossible to select a subset of cards with a product equal to . All segments, in which Kmes will divide the cards, must be bad.
Formally, the segment is bad if there are no indices such that , and .
Help Kmes determine the minimum number of bad segments in order to enjoy his favorite dish.
The first line contains a single integer () — the number of test cases.
The first line of each set of input data gives you integers and () — the number of cards and the integer, respectively.
The second line of each set of input data contains integers () — the prices on the cards.
It is guaranteed that the sum of over all sets of test data does not exceed .
For each set of input data, output the minimum number of bad segments.
Input
The first line contains a single integer () — the number of test cases.
The first line of each set of input data gives you integers and () — the number of cards and the integer, respectively.
The second line of each set of input data contains integers () — the prices on the cards.
It is guaranteed that the sum of over all sets of test data does not exceed .
Output
For each set of input data, output the minimum number of bad segments.