#P2663. Tetrahedroid

    ID: 1560 远端评测题 1000ms 32MiB 尝试: 0 已通过: 0 难度: (无) 上传者: 标签>HDU男生专场公开赛——赶在女生之前先过节(From WHU)

Tetrahedroid

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.

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
3 1