Bubblegram ---------- Iffy the `artist' produces a kind of abstract painting that he calls a `bubblegram'. This consists of a bunch of non-intersecting circles that Iffy paints different colors. To help him, Iffy has built a machine that will project a random circle on the canvas. He can then accept or reject the circle. However, many of his bubblegrams have so many circles that Iffy has trouble seeing if the projected circle intersects any existing circle. So he wants you to build a second machine that tells him if a projected circle intersects an existing circle. More specifically, he wants your machine to output the FIRST one of the following `judgments' that applies: inside The projected circle is inside some existing circle, OR, some existing circle is inside the projected circle. overlap The projected circle partly overlaps an existing circle (the intersection has non-zero area less than the area of either circle). touch The projected circle just touches an existing circle. outside The projected circle is completely outside all existing circles. As a first cut, you are to write a program that works if there is only one existing circle. Input ----- A sequence of test cases. Each test case consists of a single line of the form: XP YP RP XE YE RE defining a projected circle with center (XP,YP) and radius RP and an existing circle of center (XE,YE) and radius RE. -1,000 <= XP,YP,XE,YE <= +1,000 1 <= RP,RE <= 500 All numbers are integers. Input ends with an end of file. Output ------ For each test case, one line, consisting of a copy of the test case input line followed by space character followed by the judgment. NOTE: Because input numbers are integers, you can solve this problem without using floating point arith- metic in a way that makes the judgments precise. The judge's solution does this. It is still possible to solve the problem using floating point if you treat tiny values as equal to zero. Display ------- The input can be displayed in X-Windows or printed by the commands display_bubbles sample.in display_bubbles sample.test print_bubbles sample.in print_bubbles sample.test where the .in or .test files can be replaced by any test case input or output file. Sample Input ------ ----- 0 0 5 0 0 4 0 0 5 1 0 4 0 0 5 1 0 6 0 0 5 8 0 4 0 0 5 8 0 3 0 0 5 9 0 3 -3 10 10 1 13 15 -3 10 10 1 13 5 -3 10 10 1 13 6 -3 10 10 9 19 6 -3 10 10 9 19 5 -3 10 10 9 19 4 Sample Output ------ ------ 0 0 5 0 0 4 inside 0 0 5 1 0 4 inside 0 0 5 1 0 6 inside 0 0 5 8 0 4 overlap 0 0 5 8 0 3 touch 0 0 5 9 0 3 outside -3 10 10 1 13 15 inside -3 10 10 1 13 5 inside -3 10 10 1 13 6 overlap -3 10 10 9 19 6 overlap -3 10 10 9 19 5 touch -3 10 10 9 19 4 outside File: bubblegram.txt Author: Bob Walton Contributor: Shai Simonson Date: Tue Oct 15 14:00:26 EDT 2019 The authors have placed this file in the public domain; they make no warranty and accept no liability for this file.