Two endpoints of two line segments on a plane are given to determine whether the two segments are intersected (there is a common point or there is a partial coincidence that intersects). If intersected, output "Yes", otherwise output "No".
输入描述:
The first line is a number of T, indicating the number of tests inputed (1 <= T <= 1000)
For next T line,each line contains 8 numbers , x1,y1,x2,y2,x3,y3,x4, y4. (8-10 ^ < = xi, yi < = 10 ^ 8)
(the two endpoints of line 1 are x1, y1, |, x2, y2, and two of the endpoints of line 2 are x3, y3, |, x4, y4).
输出描述:
For each test case, output"Yes" if the two segments intersected, else output"No".
示例1
输入
复制
2
1 2 2 1 0 0 2 2
-1 1 1 1 0 0 1 -1