2276: round and sanjiao

内存限制:128 MB 时间限制:1.000 S
评测方式:文本比较 命题人:
提交:5 解决:2

题目描述

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!

输入

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).

样例输入 复制

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