#P9855. Vector
Vector
Vector
Problem Description
Given four three-dimensional vectors , determine whether there exist non-negative real numbers that satisfy the following equation:
Here, represents the components of the three-dimensional vector . For example, , , , has a non-negative solution because .
Input
The first line contains an integer , representing the number of test cases. Each test case consists of a single line containing integers in $a_{11}, a_{12}, a_{13}, a_{21}, a_{22}, a_{23}, a_{31}, a_{32}, a_{33}, a_{41}, a_{42}, a_{43}(0 \leq a_{ij} \leq 10^4,1\leq i \leq 4,1\leq j \leq 3)$, representing the components of the four three-dimensional vectors .
Output
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".
Sample Input
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
Sample Output
YES
NO
Source
2023“钉耙编程”中国大学生算法设计超级联赛(6)