Longest chain#98

Longest chain

10 seconds
64 megabytes
Medium

There is a list of positive integers. Find the size of the largest subset whose elements can be ordered into a chain such that, for every pair of consecutive elements in this chain, one divides the other.

Input

The first line contains the number of tests (1 \leq T \leq 35).

Each of the next lines contains the number of elements (2 \leq N \leq 17) and positive integers, each between and 10^9, inclusive.

Output

Output lines in the form Case #: , where is the test number (starting from ), and is the answer for this test case.

Examples

Example 1

Loading
Loading