Marks :100
: 1 | : 0
Given 3 points a(x1,y1), b(x2, y2), c(x3, y3) check if they form a non-degenerate triangle or not. If they do form a triangle then check if points p(xp, yp) and q(xq, yq) lie inside or on the triangle.
The first line of input contains coordinates of a(x1,y1)($$$0\le a \le 10^5$$$).
The second line of input contains coordinates of b(x2,y2)($$$0\le b \le 10^5$$$).
The third line of input contains coordinates of c(x3,y3)($$$0\le c \le 10^5$$$).
The fourth line of input contains coordinates of p(xp,yp)($$$0\le p \le 10^5$$$).
The fifth line of input contains coordinates of q(xq,yq)($$$0\le q \le 10^5$$$).
Print the following
0 if triangle is non degenrate
1 if p is inside triangle and q is not
2 if q is inside triangle and p is not
3 if p,q are inside triangle
4 if none are inside
0 0 100 0 0 200 12 21 21 21
3
0 0 1 1 2 2 12 21 21 21
0
You need to login to view your submissions.
You need to login to view all submissions.
Result : Executed
Feel something is wrong with the test cases?
Result : Accepted
Test Cases :
But to Run or Submit the Problem, you need to Log In.
Continue to Log InYour challenge has been submitted successfully.
You will get a response soon via WhatsApp or Email.
Do let us know your issue.