Sherif and the Bombs
Practice
4.5 (11 votes)
Open
Approved
Easy
Mathamatics
Problem
72% Success 3168 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code

The Sheriff of the Hackers' community had a very urgent job to do. He needs to diffuse all the bombs placed by Joker. Joker is extremely clever and cruel. He selected a region of 1000 X 1000 points, chose N center points of the form (X,Y) and placed bombs on every integral point that was on or inside the circular region of radius R around that chosen point. Then he went to every such point and activated those bombs that lied on or inside at least two such circular regions.

In order to make an efficient plan for the Bomb Disposal Squad, You need to help the Sheriff to determine the number of active bombs.

INPUT:
The first line of the input contains the N. Next N lines contain 3 space separated integers X Y R as described above.

OUTPUT:
Print the number of active bombs.

CONSTRAINTS:
1 <= N <= 10
1 <= X,Y,R <= 1000
NOTE : The search area for the Sheriff is a square with diagonal points (1,1) and (1000,1000)

Problem Statement in native language: http://hck.re/9E2gZN

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:50
4 votes
Tags:
ApprovedCombinatoricsData StructuresFenwick TreeFenwick treeHardOpenTrees
Points:20
96 votes
Tags:
ReadyMathematicsApprovedEasyMathamatics
Points:20
22 votes
Tags:
Ad-HocData StructuresOpenApprovedMathEasyMathamatics