SMPCIRC - Two Circles

Given two circles: O1 with the center o1 = (x1, y1) and a radius r1 and O2 with the center o2 = (x2, y2) and radius r2, please compute if O1 is inside O2 or if O2 is inside O1.


First t < 1000, the number of test cases. In each of the following t lines, 6 integers: x1 y1 r1 x2 y2 r2. Where 0 ≤ x1, y1, x2, y2 ≤ 10000 and 0 < r1, r2 ≤ 10000.


For each test case print one character:

  • I, if O1 is inside O2 (or if O2 is inside O1),
  • E, if O1 is internally tangent to O2 (or if O2 is internally tangent to O1),
  • O, in other cases.


103 104 5 100 100 10
103 104 10 100 100 10


hide comments
bravura_coder: 2021-05-11 10:58:44


elliotto: 2020-08-15 14:36:28

Make sure that you output "E" when the two circles are equal. This actually isn't mathematically correct, but it's the way that these tests seem to work.

abhiguna25: 2020-06-12 21:00:55

my code is working on codeblocks but ideone is showing error.

aniruddh_1: 2020-04-05 12:34:27

my code perfectly works on ideone but it is not getting submitted on the online judge as it is showing wrong answer.
Can somebody help?

Last edit: 2020-04-05 12:34:47
nadstratosfer: 2020-03-25 21:42:47

The constraints hold and the input is correctly formatted.

domin144: 2020-03-25 19:34:08

To problem author: Please check the ranges in the input data. I kept getting NZEC, until I removed the asserts checking the input.

jukerburg10: 2019-08-09 03:37:48

also got WA!!

Last edit: 2023-02-10 07:32:20
harshuraj2710: 2018-10-21 06:34:04

It is easy mainly we have to find the distance between the two centres
and thereafter keep in mind all the 5 cases .

dewa251202: 2018-09-18 04:38:58

lmao, i got the 999th and 1000th ac

aquib_ansari: 2018-06-26 17:46:16

I have correctly written the code in devC++ using C, but here its showing wrong answer; help!

Added by:kuszi
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64