问题 C: Vector

内存限制:64 MB 时间限制:1 S
题面:传统 评测方式:文本比较 上传者:
提交:1 通过:1

题目描述

Given four three-dimensional vectorsA1,A2,A3,A4, determine whether there exist non-negative real numbers x1,x2,x3 that satisfy the following equation:

x1A1+x2A2+x3A3=A4

Here, Ai=(ai1,ai2,ai3) represents the components of the three-dimensional vector Ai.

For example, A1=(3,4,4)A2=(4,3,0)A3=(2,3,2)A4=(9,10,6) has a non-negative solution because A1+A2+A3=A4.

输入格式

The first line contains an integer T (1≤�≤1000)1T1000, representing the number of test cases.

Each test case consists of a single line containing 1212 integers

a11,a12,a13,a21,a22,a23,a31,a32,a33,a41,a42,a430aij104,1i4,1j3, representing the components of the four three-dimensional vectors A1,A2,A3,A4.

输出格式

For each test case, output a single line containing either "YES" or "NO", indicating whether a non-negative solution exists.

If a non-negative solution exists, output "YES"; otherwise, output "NO".

输入样例 复制

2
3 4 4 4 3 0 2 3 2 9 10 6 
0 3 1 0 1 3 4 0 4 4 1 10 

输出样例 复制

YES
NO