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

Feodor Volonter