F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Fruit Ninja

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 1098    Accepted Submission(s): 536


Problem 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
 

Author
NotOnlySuccess
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-05-04 19:31:20, Gzip enabled