DCP-512: Three Circles Back to All Problems

Easy Geometry > Basic Geometry


Consider three circles in the plane. In how many closed regions will they divide the plane? A closed region is a region complete with its boundary. To simplify the problem we introduce three additional conditions: <ul> <li>The circles can intersect but can not touch each other; <li>There are no points in which intesect all three circles; <li>No circles coincide. </ul> <p> Input: ------ The first line of input contains an integer **T** (**1 ≤ T ≤ 1000**) representing the number of test cases. Each of the following test case contains three lines each one consists of three blank separated positive integers **X**, **Y** and **R** representing the coordinates of center and radius of a circle (**0 < X, Y, R ≤ 1000**). Output: ------- For each test case print a line in "**Case N: R**" format where **N** is the case number and **R** is the number of closed regions. Sample Input ------------ 3 100 100 10 100 100 20 100 100 30 14 14 2 16 16 1 18 18 2 120 120 120 60 60 80 180 60 80 Sample Output ------------- Case 1: 3 Case 2: 5 Case 3: 7


Problem Setter:

Feodor Volonter

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 2.00
Go 2.00
Java 2.00
JavaScript 2.00
Objective-C 2.00
Perl 2.00
PHP 2.00
Python 2.00
Python3 2.00
Ruby 2.00
VB.Net 2.00

Problem Stats

29/63

Solve/Submission

Ranking

# User Language Timing
01 dipta007 Cpp14 0.00s
02 Zeronfinity Cpp 0.00s
03 tariqiitju Cpp14 0.00s
04 showmic Cpp14 0.00s
05 feodorv C 0.00s
06 prateepm Cpp14 0.00s
07 gultai4ukr Cpp14 0.00s
08 cjoa Cpp 0.00s
09 m_arif Cpp14 0.01s
10 tahsin_protik C 0.01s
11 Informatimukas Cpp 0.01s
12 Ahb_arif Cpp14 0.01s
13 kzvd4729 Cpp14 0.01s
14 DynamicOvi Cpp 0.01s
15 PKP_Junior Cpp 0.01s
16 QuwsarOhi Cpp14 0.01s
17 Satkhira Cpp 0.01s
18 MAD_coder Cpp 0.01s
19 MRITuhin Cpp 0.01s
20 rayhan50001 Cpp 0.01s
21 sdpsarker88 Cpp 0.01s
22 shaft Cpp14 0.02s
23 shahed95 Cpp 0.02s
24 Essux Cpp 0.02s
25 BohdanPastuschak Cpp14 0.02s
26 mamun4122 Cpp14 0.03s
27 radoslav11 Cpp14 0.92s
28 Miggatenagokui Cpp14 0.98s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support