Comments

where is the problem?

excited! it may be Educational Hackforces Round 1, very very interesting.

Thanks a lot, add another one "signed area of triangle" A is stand for the signed area of a triangle,

(2A=
\begin{vmatrix}
x_0 & y_0 & 1 \
x_1 & y_1 & 1 \
x_2 & y_2 & 1 \
\end{vmatrix}
=x_0y_1+x_2y_0+x_1y_2-x_2y_1-x_0y_2-x_1y_0
) btw:two dollar signs are Omitted
for more useful tips of LaTeX, this website may help
http://meta.math.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference