Geometry Enjoyer
시간 제한7초메모리 제한2048 MB
어떤 볼록 다각형의 각 변을 연장한 직선들의 교점들이 주어질 때, 원래 다각형의 꼭짓점을 복원한다.
문제
Altair was playing with the points on the plane (as usual). At some point, he discovered a new game that he will play with you.
He made a convex polygon with sides on the two-dimensional plane. The polygon had a really nice property: no pair of sides are parallel. Then he extended every side of the polygon to a line, and found the intersection point for every pair of lines.
Now he gives you the points he got. You should find the initial polygon.
입력
The first line contains one integer (): the number of points.
Each of the next lines contains four integers, , , , and (, ): the coordinates of the -th point. The coordinate equals , and the coordinate equals . It is guaranteed that the values and are coprime, and the values and are coprime.
It is guaranteed that the polygon can be uniquely determined by the given points.
출력
The first line of the output should contain one integer : the size of the polygon.
You can output the vertices of the polygon in any order.
Each of the next lines should contain four integers, , , , and (, ): the coordinates of the polygon vertices. The coordinate equals , and the coordinate equals . The values and should be coprime, and the values and should be coprime.