ГлавнаяСборникиТурнирыРазделыФорумыУчастникиПечатьПомощьО системе

Турниры > IMPC-2014-15 Questions > задача:


1st-4. 50473 - Counting Circles Positions

IMPC-2014-15 Questions

Старт: 22.ноя.2014 в 15:00:00
Финиш: 22.ноя.2014 в 20:00:00
Турнир завершён!
• Турнирная таблица

Гость
• Вопросы к жюри (1)

Задачи турнира

• 0th-1. 50402 - Hello World!
• 0th-2. 50403 - Number of Chairs
• 0th-3. 50763 - Valid Password
• 0th-4. 50404 - Sum of Self Powers
• 0th-5. 50692 - How much money?
• 1st-2. 50483 - Group Total
• 1st-3. 50484 - Number Of Letters
• 1st-4. 50473 - Counting Circles ...
• 1st-6. 50485 - Center of gravity of ...
• 2nd-1. 50522 - Multiplication Table - 2
• 2nd-2. 50512 - Coding redundancy
• 2nd-3. 50533 - Contacts List
• 2nd-5. 50793 - Top M Customers
• 2nd-6. 50486 - Problems and Progr...
• 3rd-2. 50405 - Accounts Receivable
• 3rd-3. 50474 - Sum of Two Primes

Обратная связь

Если у вас есть предложения или пожелания по работе Contester, посетите форум сайта www.contester.ru.

Лимит времени 2000/4000/4000/4000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
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