Circles

Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others)

Problem Description

      Consider N different circles on the plane. They divide it to several parts, you have to find the number of these parts.

      For the purpose of this problem the circle of radius r with center (x0, y0) is the set of points

Input

      The first line of each test case contains N - the number of circles (1 <= N <= 50). Next N lines contain three integer numbers x0, y0, and r each - the coordinates of the center and the radius of the circle. All coordinates do not exceed 103 by their absolute value, all radii are positive and do not exceed 103. No two circles coincide.

Output

      For each test case, output K - the number of parts circles divide the plane to, in a single line.

      Due to floating point precision losses possible, do not consider parts with area not exceeding 10-10.

Sample Input

2
0 0 3
0 0 2

Sample Output

3

Source

Andrew Stankevich Contest 4

Manager

Information
Solved Number28
Submit Number163
Problem Tags
No tag edit access
温馨提示:AC后可以编辑标签哦. ^-^
Login
LoginCancel