Making a Tetrahedron
Time limit1sMemory limit128 MB
For each of up to 10000 sets of six edge lengths, decide whether some assignment to a tetrahedron gives non-zero volume.
- Level
Medium7 of 10
- Topics
- Geometry, Sorting, Brute force, Math
- Solved
- No attempts yet
Problem
It is well known that you cannot make a triangle with non-zero area whose sides have lengths 1, 2, and 3. Can you make a tetrahedron with non-zero volume whose six edges have lengths 1, 2, 3, 4, 5, and 6?
You may assign the six given lengths to the six edges of the tetrahedron in any arrangement. The answer is affirmative if some arrangement yields a tetrahedron with strictly positive volume.
Input
The first line contains an integer , the number of lines that follow ().
Each of the next lines contains six space-separated positive integers, the lengths of the edges of the desired tetrahedron. Each edge length is at most .
Output
Output lines. For each query, print YES if it is possible to construct a tetrahedron with non-zero volume from the six given edge lengths, or NO if it is not possible.