There are two integer points A and B in the 2-D plane. We need to find another point C satisfying the following conditions:
C has to be different from A and B.
There is no integer coordinate point on the line segment AC other than its endpoints.
There is no integer coordinate point on the line segment BC other than its endpoints.
Triangle ABC must have a positive area.
There is no integer coordinate point strictly inside ABC.
Constraints:
1.|Ax| <= 1e9, |Ay| <= 1e9, |Bx| <= 1e9, |By| <= 1e9.
2.Cx and Cy must be within [-1e14, 1e14].
Problem link: problem D