Codeforces Round 462 (Div. 1)
C
A Colourful Prospect
Codeforces
2700
原题
← BD →
翻译中…

Firecrackers scare Nian the monster, but they're wayyyyy too noisy! Maybe fireworks make a nice complement.

翻译中…

Little Tommy is watching a firework show. As circular shapes spread across the sky, a splendid view unfolds on the night of Lunar New Year's eve.

翻译中…

A wonder strikes Tommy. How many regions are formed by the circles on the sky? We consider the sky as a flat plane. A region is a connected part of the plane with positive area, whose bound consists of parts of bounds of the circles and is a curve or several curves without self-intersections, and that does not contain any curve other than its boundaries. Note that exactly one of the regions extends infinitely.

翻译中…

Input

翻译中…

The first line of input contains one integer $*n*$ ($1 ≤ *n* ≤ 3$), denoting the number of circles.

翻译中…

The following $*n*$ lines each contains three space-separated integers $*x*$, $*y*$ and $*r*$ ($- 10 ≤ *x*, *y* ≤ 10$, $1 ≤ *r* ≤ 10$), describing a circle whose center is $(*x*, *y*)$ and the radius is $*r*$. No two circles have the same $*x*$, $*y*$ and $*r*$ at the same time.

翻译中…

Output

翻译中…

Print a single integer — the number of regions on the plane.

翻译中…

Note

翻译中…

For the first example,

翻译中…

image

翻译中…

For the second example,

翻译中…

image

翻译中…

For the third example,

翻译中…

image

翻译中…

样例

Input #1
3
0 0 1
2 0 1
4 0 1
Output #1
4
InputCopy OutputCopy
Input #2
3
0 0 2
3 0 2
6 0 2
Output #2
6
InputCopy OutputCopy
Input #3
3
0 0 2
2 0 2
1 1 2
Output #3
8
InputCopy OutputCopy
题目信息
题号
933C
时间限制
1 s
内存限制
256 MB
标签
计算几何
图论

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。