HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Repetition (Loops) > problem:


072. 50473 - Counting Circles Positions

Guest
• Review clarifications (1)

Volume problems

• 025- 2013-Nov-01. 50328 - How far ...
• 026. 50487 - Radius of Inscribed Circle
• 027. 50548 - Albanian Airlines
• 028. 50483 - Group Total
• 033. 50588 - Processing the list of n...
• 035. 50573 - Count and Sum
• 044. 50597 - Drawing Diamonds
• 058. 50574 - Triangular Numbers
• 072. 50473 - Counting Circles P...
• 118. 50514 - Bookkeeping
• 125. 50484 - Number Of Letters
• 132. 50504 - School contest
• 136. 50443 - Dajte Express
• 147. 50553 - Divisible by m
• 148. 50596 - Your Ride Is Here (US...
• 148. 50596 - Your Ride Is Here (US...
• 150. 50763 - Valid Password

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 2000/4000/4000/4000 ms. Memory limit 65000/65000/65000/65000 Kb.
Prepared by Erjon Dauti.

Counting Circles Positions

In a Cartesian coordinate system you are given some circles with a specified radius for each. Two circles can:

  • Intersect each other if they have one or two points in common.
  • Not intersect each other if they do not have any point in common.
  • Overlap if they have all their points in common.
You are provided the Cartesian coordinates of the center of each circle as well as the radius of them, you have to find the number of circle pairs that intersect each other, do not intersect each other and overlap each other.

Question: Write a program that gets the number (n) of the circles, the Cartesian coordinates of each center of the circles (x, y) as well as the radius (r) of the circle and displays the number of circle pairs that intersect each other, do not intersect each other and overlap each other.

Input specification
You will be given a number (n) in the first line where (n) is between 2 and 1000. Then in the following (n) lines, you will be given (n) integer pairs (x, y) where -5000 ≤ (x and y) ≤ 5000 and the radius (r) of the circle where 1 ≤ r ≤ 5000.

Output specification
Show the number of circle pairs that

  1. intersect each other,
  2. do not intersect each other and
  3. overlap each other
exactly in this order separated by one space.

 Sample Input I     Sample Input II   
2
0 0 1
1 1 1
4
0 0 1
0 0 1
4 3 2
1 1 1
 Sample Output I     Sample Output II   
1 0 0 2 3 1


Для отправки решений необходимо выполнить вход.

www.contester.ru