ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests

Timus Top Coders: First Challenge

About     Problems     Submit solution     Judge status     Standings
Contest is over

I. Biscuits

Time limit: 1.0 second
Memory limit: 64 MB


Everyone knows that a glass is the most useful thing to make biscuits. And big biscuit lover Michael broke his only glass yesterday. But this didn't stop him from doing his favorite thing.


Michael prepared dough, then rolled out it on the surface of the table as a circle of radius 32000 with a center at point (0, 0) and finally started to cut biscuits. It must be said that he tried his best and even perspired profusely. Since Michael had not got any glass, he used all round objects he could reach - pickle-jars, herring-cans, pots, a collection of beer mugs, and even bottle lids. Over and over again Michael took the next round object of radius R[i], put it on the surface of the dough so that its center was at point with Cartesian coordinates X[i] and Y[i]. As a result of each action the next thin round cut appeared on the surface of the dough - an outline of future biscuit.
As soon as the last pot was soiled, and favorite tea-set vanished into the depth of the bin, Michael finally stopped and looked at the result of his work. His eyes grew dim, and his forehead furrowed. The point was that some cuts intersected, so not all of the biscuits were round. Some of them even had holes. But it could not stop Michael, who is going to calculate the number of prepared biscuits.


The first line contains the integer number N (0 ≤ N ≤ 500). Each of the next N lines contains the integer numbers X[i], Y[i] (-10000 ≤ X[i], Y[i] ≤ 10000) and R[i] (1 ≤ R[i] ≤ 10000) for the corresponding cut.
It is guaranteed that any two distinct intersection or touch points of the cutting circles lay at the distance of at least 10-3.


You should output the number of the biscuits prepared by Michael.


-1 0 2
1 0 2
0 0 3
Problem Author: Nikita Rybak, Ilya Grebnov, Dmitry Kovalioff
Problem Source: Timus Top Coders: First Challenge
To submit the solution for this problem go to the Problem set: 1429. Biscuits