Fruit Ninja

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 3952
64-bit integer IO format: %I64d      Java class name: Main

Description

Fruit Ninja is a popular classic game. During the game, fruits will up to the air, and your aim is cut as more fruits as possible with a line.

Even if the line touch a point of a fruit, the fruit also be cut.

Input

The first line is a number T(1<=T<=30), represents the number of case. The next T blocks follow each indicates a case.
The first line of each case contains one integer N (1<=N<=10)
Then N lines follow, each line contains a integer K(3<=K<=10), represent the number points of the fruit, then K*2 integers follow, each two integers represent one point of the fruit.(with anticlockwise order)
I promise all fruits are convex polygon, and any two fruit have no common point.

Output

For each case, output the number of case and the maximum fruits you could cut with a line.(as shown in the sample output)

Sample Input

2
3
3 0 0 1 0 1 1
3 1 2 2 1 2 2
3 3 1 3 0 4 0
3
4 0 0 1 0 1 1 0 1
4 2 0 3 0 3 1 2 1
4 0 99 1 99 1 100 0 100

Sample Output

Case 1: 3
Case 2: 2

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .