Drop Stick ---- ----- Tiny Joe and his friends play a game they call Drop Stick. They go to a high place and drop a straight stick to see if they can hit a circular target far below them. However, Tiny Joe and his friends live in the year 2057 and all games are in virtual reality. So to play this game, they got you to program it. You have available subroutines to create the high and low places and define the circle and even drop the stick. But you need a new subroutine to determine if the dropped stick touches the circle. The subroutines you are given tell you the diameter of the circle and the distances from its center of the two stick ends after the stick has been dropped. You also know the length of the stick. You must determine if the stick touches any part of the circle. Input ----- For each test case, one line of the form R L D1 D2 giving the radius R of the circle, the length L of the stick, and the distances D1 and D2 of the two endpoints of the stick from the center of the circle. Numbers are floating point. 1 <= R,L <= 1,000 0 <= D1,D2 <= 10,000 D1 + D2 >= L D1 + L >= D2 L + D2 >= D1 Input ends with an end of file. Output ------ For each test case, one line containing R L D1 D2 ANS where R, L, D1, D2 are copied from the input and must be printed with at least 3 decimal places, and ANS is either `TOUCH' or `NO-TOUCH'. The input will be such that the distance from the center of the circle to the nearest point on the stick will differ from R by at least 0.001. Sample Input ------ ----- 100 200 200 200 100 200 110 110 100 200 150 150 100 200 140 140 1 2 1.412 1.412 1 2 1.417 1.417 1 1.4142135 1 1 1 3 1.1 3 1 2 1.1 1.1 1 2 0.9 2 1 2 1.02 2 1 2 1.1 2 Sample Output ------ ------ 100.000 200.000 200.000 200.000 NO-TOUCH 100.000 200.000 110.000 110.000 TOUCH 100.000 200.000 150.000 150.000 NO-TOUCH 100.000 200.000 140.000 140.000 TOUCH 1.000 2.000 1.412 1.412 TOUCH 1.000 2.000 1.417 1.417 NO-TOUCH 1.000 1.414 1.000 1.000 TOUCH 1.000 3.000 1.100 3.000 NO-TOUCH 1.000 2.000 1.100 1.100 TOUCH 1.000 2.000 0.900 2.000 TOUCH 1.000 2.000 1.020 2.000 TOUCH 1.000 2.000 1.100 2.000 NO-TOUCH Display ------- The commands display_dropstick -X dropstick.out display_dropstick -X dropstick.in may be useful. The command `display_dropstick -doc' documents the display_dropstick program. File: dropstick.txt Author: Bob Walton Date: Sat Oct 6 02:52:02 EDT 2018 The authors have placed this file in the public domain; they make no warranty and accept no liability for this file.