0195. Creativity

Имя входного файла: creativ.in
Имя выходного файла: creativ.out
Ограничение по времени: 250 ms
Ограничение по памяти: 32 megabytes

Famous Saratov artist Madzinski-Kalevich decided to make us happy with his new masterpiece. He has drawn N arcs of circles on a plain sheet of paper. You are to find number of common points of all arcs.

Radius of each circle does not exceed 1000.

Input file

First line of the input contains single integer number N (1 ≤ N ≤ 50). Each of the next N lines contains description of one arc. Description of an arc consists of cartesian coordinates (x,y) of three points: two ends of the arc and an arbitrary point on it, which is not equal to arcs' ends. You may assume that all coordinates don't exceed 1000 by absolute value. Numbers in a line are separated by spaces.

Output file

First line of output file must contain M – quantity of different common arcs' points. Next M lines must contain coordinates of these points. Output (x, y) pairs in lexicographical order with 3 decimal digits. Separate x and y by a single space. Here we assume that lexicographically ordered points are sorted by nondescending of first coordinate (x), and by second (y) in the case of a tie. If there are infinitely many common points, output file must contain single word "Infinity" without quotes. It is known that if quantity of common points is not infinite, the distance between any two different points is at least 0.005.

Examples:

creativ.increativ.out
3 7 4 7 -4 3 0 2 2 6 2 4 0 0 4 0 -4 4 0 4 3.009 0.263 3.500 -1.936 3.500 1.936 4.000 0.000


Источник: Petrozavodsk Summer 2003. Saratov SU Contest, Wednesday, August 27

Обсудить       Отправить решение



Версия для печати