Given three non-collinear coordinates P(p1,p2), Q(q1,q2) and R(r1,r2) of a triangle in X-Y plane, find the number of integral / lattice points inside this triangle.(A point in XY plane is said to be integral / lattice point if both its co-ordinates are integral)
The first line of input contains an integer T denoting the number of test cases. Then T test cases follow. The first line of each test case contains an two integers (p1 p2), second line of the testcase contains ( q1 q2) and the third line of the testcase contains ( r1 & r2) denoting the coordinates P, Q, R respectively.
Print out the count of integral points lying inside the triangle .
1 <= T <= 100
-100 <= P, Q, R <=100
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.