Logo
(追記) (追記ここまで)

5455번 - Mandalas 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB10118914.754%

문제

Shasita is drawing mandalas. First, she draws some circles, and then she colours the obtained regions.

Her younger sister Rice wants to help her drawing the mandalas. They agree Rice will draw the circles and Shasita will colour them. Shasita does not want to colour a very large number of all small regions and therefore she fixes the number of regions Rice should create by drawing the circles. Rice, on her side, is not very good at counting regions and she asks you to help her.

In this task you have to give the number of regions in a given mandala.

입력

The first line of the input file contains a single number: the number of test cases to follow. Each test case has the following format:

  • one line with the integer 0 ≤ n ≤ 500, the number of circles in this test case
  • n lines, each with the three integers xi, yi and ri, describing the ith circle, which has midpoint (xi, yi) and radius ri, with |xi| , |yi| ≤ 1000 and 0 < ri ≤ 1000.

출력

For every test case in the input file, the output should contain a single number, on a single line: the number of regions the circles divide the plane R2 in.

제한

예제 입력 1

3
1
5 7 10
2
0 0 5
10 0 5
3
0 0 7
10 10 7
0 10 8

예제 출력 1

2
3
6

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2005 Preliminaries D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /