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

Heroes Arrangement

Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 245    Accepted Submission(s): 22


Problem Description
There are N heroes in the Kingdom of Heroes, each hero has a special range of activity, this ¡°range¡± is a delta-shaped region (triangle region including the boundary; it is guaranteed that all triangles will neither degenerate into a segment nor a point on the King¡¯s angle of view), and heroes can appear in any point in his activity range. The king, standing at the Origin (0, 0, 0), is observing the heroes. No range of activity will contain the king¡¯s position.

You may assume that no hero could meet others, that means these ¡°range¡± have no common point. Your task is to find number K, indicating that the king can choose at most K heroes such that no pairs of chosen heroes cause one may block the king¡¯s view line to observe another. In other words, no hero can appear on the segment between another hero and the King.
 

Input
There are multiple test cases, the number of them, T, is given in the very first line of the input, followed by T cases.

For each test case:
First line contains an integer N, the number of heroes, 1¡ÜN¡Ü40. Then N lines follow, each line contains nine integers x1 y1 z1 x2 y2 z2 x3 y3 z3, denoting the coordinates of the delta-shaped regions¡¯ vertex respectively, -100¡Üx1, y1, z1, x2, y2, z2, x3, y3, z3¡Ü100.
 

Output
Output a single line with a number K with case number, the maximum number of heroes that king can choose.
 

Sample Input
2 2 0 0 1 1 2 1 -1 2 1 0 0 2 1 -2 2 -1 -2 2 2 0 0 1 1 2 1 -1 2 1 0 0 -1 1 -2 -1 -1 -2 -1
 

Sample Output
Case #1: 1 Case #2: 2
 

Hint

The sample image of the sample input is drawn below, the small sphere is the position of the king.

 

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-04-19 23:14:23, Gzip enabled