We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Mathematics
- Geometry
- Sherlock and Planes
Sherlock and Planes
Sherlock and Planes
Watson gives four 3-dimensional points to Sherlock and asks him if they all lie in the same plane. Your task here is to help Sherlock.
Input Format
First line contains T, the number of testcases.
Each test case consists of four lines. Each line contains three integers, denoting xi yi zi.
Output Format
For each test case, print YES
or NO
whether all four points lie in same plane or not, respectively.
Constraints
1 ≤ T ≤ 104
-103 ≤ xi,yi,zi ≤ 103
Sample Input
1
1 2 0
2 3 0
4 0 0
0 0 0
Sample Output
YES
Explanation
All points have zi = 0, hence they lie in the same plane, and output is YES