Circles (2)

To solve this exercise you will need the definitions and the procedures of problems P46254 and P84786.

Write a procedure that reads a point:

    void read(Point& p);

which is in the input with the two reals @x@ and @y@ in this order.

Write also a procedure that reads a circle:

    void read(Circle& c);

which is in the input with the three reals @x@, @y@, and @radius@ in this order.

Use all this to write a program that reads a circle @c@ and an initial point @p@, and moves @p@ according to the input, and prints when @p@ go in or go out of @c@. Suppose that @p@ will never be exactly in the border of @c@.

Input

Input starts with a line with the circle @c@ (three reals, the last one strictly positive) and a line with the point @p@ (two reals). Then a natural number nn comes followed by nn lines, each one with a point that indicates the following move of @p@.

Output

Your program must print the initial situation of @p@ regard to @c@, and the moments that the point goes in or goes out of the circle. Follow the format of the examples.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T10:41:28.505Z

© Jutge.org, 2006–2026.
https://jutge.org