Shootout!

3.7

178 votes
Geometry, Hiring, Approved, Easy
Problem

A and B are police while C and D are thieves. A and C are shooting at each other while B and D at each other. Now given the co-ordinates of all four, you have to find whether a "Bullet Path" problem can occur or not. Now a "Bullet Path" problem is caused when the paths A-C and B-D do not cross properly or do not cross at all or when A, B, C and D lie on the same line. There are some tactical reasons why the path should cross in a proper way. The paths do not cross properly means that one of the police/thieves is on the crossing point itself.

Crossing paths

Given the points, print "Yes"(without quotes) if "Bullet Path" problem can occur, "No"(without quotes) if not.

Input format:
The first line contains T, the number of test cases. For each test case, there will be four lines, each containing two space separated integers denoting the X and Y co-ordinates of the A, B, C and D respectively.

Output Format:
For each test case print a single line containing the answer.

Constraints:
1 <= T <= 104
-105 <= X,Y <= 105

Note: During some calculations the integers may not fit in 64bit data types. Please be careful with some languages.

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?