Problem
You're in the middle of writing your newspaper's endofyear economics summary, and you've decided that you want to show a number of charts to demonstrate how different stocks have performed over the course of the last year. You've already decided that you want to show the price of n different stocks, all at the same k points of the year.
A simple chart of one stock's price would draw lines between the points (0, price_{0}), (1, price_{1}), ... , (k1, price_{k1}), where price_{i} is the price of the stock at the ith point in time.
In order to save space, you have invented the concept of an overlaid chart. An overlaid chart is the combination of one or more simple charts, and shows the prices of multiple stocks (simply drawing a line for each one). In order to avoid confusion between the stocks shown in a chart, the lines in an overlaid chart may not cross or touch.
Given a list of n stocks' prices at each of k time points, determine the minimum number of overlaid charts you need to show all of the stocks' prices.
Input
The first line of input will contain a single integer T, the number of test cases. After this will follow T test cases on different lines, each of the form:
n k price_{0,0} price_{0,1} ... price_{0,k1} price_{1,0} price_{1,1} ... price_{1,k1} ... price_{n1,0} price_{n1,1} ... price_{n1,k1}
Where price_{i,j} is an integer, the price of the ith stock at time j.
Output
For each test case, a single line containing "Case #X: Y", where X is the number of the testcase (1indexed) and Y is the minimum number of overlaid charts needed to show the prices of all of the stocks.
Limits
1 ≤ T ≤ 100
2 ≤ k ≤ 25
0 ≤ price_{i,j} ≤ 1000000
Small Input
1 ≤ n ≤ 16
Large Input
1 ≤ n ≤ 100
Sample
Input 
Output 
3

Case #1: 2
