#2607. Circle and triangle

Circle and triangle

说明

        There is a circle and a triangle in the world of geometry. Now give you the position of both of them, can you tell the position relationship between them? Isn’t it too simple? GOOD LUCK && HAVE FUN!


输入格式

<!-- @page { margin: 0.79in } P { margin-bottom: 0.08in; direction: ltr; color: #000000; text-align: justify; widows: 0; orphans: 0 } P.western { font-family: "Times New Roman", serif; font-size: 10pt; so-language: en-US } P.cjk { font-family: "宋体", "SimSun"; font-size: 10pt; so-language: zh-CN } P.ctl { font-family: "Times New Roman", serif; font-size: 10pt; so-language: ar-SA } -->

       The first line of input contains an integer t (1<=t<=100), which is the number of test cases. For each case, the first line consists of three integers x, y and r which represent the position of the center of the circle and the radius of the circle. The second line consists of six integers which represent the three points of the triangle (the absolute value of each coordinate is less than 1000, and 0 < r < 1000).

输出格式


For each case output one line like "Case #K: M", K means the case number, and M means the position relationship between the circle and the triangle (M=”OO” when Deviation or tangency; M = "II" when inclusion; M="XX" when intersect which means the common area between them is not zero ).

3
0 0 1
-5 -5 0 5 5 0
0 0 1
-2 -1 0 1 2 1
0 0 1
5 5 6 5 6 6
Case #1: II
Case #2: XX
Case #3: OO