CandyCon
Practice
0 (0 votes)
Easy
Problem
89% Success 65 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

Shubh loves to eat a lot of candies. This year Aurora Core team has decided to organise an event called CandyCon in which a participant can win a lot of candies. Shubh decided to take part in this event so he can win a large no. of candies.

The CandyCon consists of a region of 1000 x 1000 points, then 'N' no. of center points of the form (x,y) are chosen and a candy is placed on each of the integral point that was on or inside the circular region of radius R around that chosen center point. Now, the candy that lied on or inside at least two such circular regions is known as Lucky Candy. If a participant can determine the total number of Lucky Candies then he/she will get infinite amount of candies. Shubh wants to win this event, can you help him ?

Input :

  • First line of the input contains an integer 'N' , i.e the total no. of center points.
  • Next N lines contain 3 space separated integers x y R as described in the question above.

Output :

  • A single line containing the total no. of Lucky Candies.

Constraints :

  • 1<=N<=10
  • 1<=x,y,R<=1000
  • The search area for the CandyCon is a square with diagonal points (1,1) and (1000,1000).

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
Tags:
Easy
Points:20
18 votes
Tags:
Ad-HocBasic ProgrammingOpenApprovedEasyMathamatics
Points:20
3 votes
Tags:
Ad-HocData StructuresOpenApprovedEasyMathamatics