Tetrahedron
Time limit2sMemory limit256 MB
Given six stick lengths, decide whether they can form the edges of a non-degenerate tetrahedron, where each edge is used once.
Problem
Contrary to the well-known saying "matches are not a toy for children," one boy still loves playing with matches. He does not play pranks with them or start fires, though; he solves various puzzles. For example, he can make the number nine equal the number eleven by moving just one match.
Recently this boy's parents gave him several sets, each consisting of six matches. The boy began building various three-dimensional geometric figures from them. He has already built many figures, but now he is curious: from which sets is it possible to glue the frame of a tetrahedron of nonzero volume using the six matches from the set and glue? Matches cannot be broken, and no match may stick out beyond the frame.
Your task is, given the match lengths for each set, to check whether the frame of a tetrahedron can be glued from them.
Input
The first line contains an integer (), the number of sets to check. The next lines each contain six integers in the range from 1 to 1000: the match lengths in the -th set.
Output
Print lines, where the -th line must contain "Yes" if a tetrahedron of nonzero volume can be assembled from the -th set, or "No" otherwise.