0137. Two Circles

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

There are two circles lying on the plane. Your task is to find all points of their intersection.

Input file

The first line of the input file contains number of test cases K (1 ≤ K ≤ 10000). Each test case consists of two lines: first contains the description of the first circle, and the second one does for the second. The description of each circle is written in the form x, y, r (-1000 ≤ x, y ≤ 1000, 0<r ≤ 1000). All numbers are integer.

Output file

For each test case you are to output one of the following messages:

  • "There are no points!!!" – if there are no intersection points.
  • "There are only i of them...." – if the circles have exactly i intersection points. In this case next i lines contain coordinates of the points x'j, y'j. Points are to be displayed in the lexicographical order (first with the smallest x, if x coordinates are equal, first with the smallest y). Numbers are to be displayed with 6 digits after the decimal point.
  • "I can't count them - too many points :(" – if there are infinitely many points of intersection.

All messages have to be displayed without quotes.

Separate output for different cases with a single blank line.

Examples:

circles.incircles.out
2 0 0 2 4 0 2 0 0 1 1000 1000 1 There are only 1 of them.... 2.000000 0.000000 There are no points!!!


Источник: Petrozavodsk Summer 2003. Blitz Kontest, Monday, August 25
Автор: Andrew Lopatin, Nick Durov

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



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