Point lies or not
Submissions: 950   Accuracy:

22.32%

  Difficulty: Basic   Marks: 1

Given three corner points of a triangle, and one more point P. Write a function to check whether P lies within the triangle or not.

Input:

The first line of input contains an integer T denoting the number of test cases.
The first line of each test case is x1,y1,x2,y2,x3,y3.
The second line of each test case contains x and y.

Output:

Print Yes if point lies inside a triangle else No. Print the output of each test case in a new line.

Constraints:

1 ≤ T ≤ 50
1 ≤ x1,x2,x3,y1,y2,y3 ≤ 100
1 ≤ x,y ≤ 70

Example:

Input
1
0 0 20 0 10 30
10 15

Output
Yes

 

** For More Input/Output Examples Use 'Expected Output' option **

Author: rajatjha


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.