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

Tetrahedroid

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


Problem Description
You are given a tetrahedroid and a point P outside it. How many faces can be seen from P?
A face can be seen form P means that if you connect P and any point in this face (exclude the boundary) with a line segment, the line segment does not intersect with other faces of the tetrahedroid.
 

Input
The input contains multiple test cases.
The first line contains a number T describing the number of test cases.
For each test case:
The first 4 lines describe the tetrahedroid in the format below:
Ax, Ay, Az
Bx, By, Bz
Cx, Cy, Cz
Dx, Dy, Dz
After that comes 1 line describing the point P in the format below:
Px, Py, Pz
 

Output
For each test case, output one line containing a integer representing the number of faces can be seen from P.
 

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

Sample Output
3 1
 

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-02 03:10:55, Gzip enabled