DMOPC '18 Contest 4 P0 - Dr. Henri and Seeing Stars

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Dr. Henri is looking through his telescope at the MRD Observatory. His telescope is positioned so that it can see all the stars inside a circle of radius R centred at the coordinates (X, Y) in the night sky. The telescope cannot see a star if it is on the edge of the circle.

Dr. Henri is interested in 3 particular stars: A, B, and C. Referring to his star charts, he notes that their coordinates are (x_A, y_A), (x_B, y_B), and (x_C, y_C) and their magnitudes are m_A, m_B, and m_C respectively. The magnitude of a star is a measure of its brightness, but interestingly, its scale is reversed: the smaller the magnitude, the brighter the star.

Dr. Henri wonders if he can see the brightest star among A, B, and C through his telescope. It is guaranteed that no two of these stars are of the same magnitude.

Constraints

1 \le R \le 100
-100 \le x_A, y_A, x_B, y_B, x_C, y_C, X, Y \le 100
-100 \le m_A, m_B, m_C \le 100

Input Specification

The first line of input will contain three space-separated integers, R, X, and Y.
The second line will contain three space-separated integers, x_A, y_A, and m_A.
The third line will contain three space-separated integers, x_B, y_B, and m_B.
The final line will contain three space-separated integers, x_C, y_C, and m_C.

Output Specification

If Dr. Henri can see the brightest star among A, B, and C, output What a beauty!. Otherwise, output Time to move my telescope!.

Sample Input 1

5 2 1
3 1 5
1 4 2
-9 1 4

Sample Output 1

What a beauty!

Sample Input 2

5 2 1
6 5 -1
0 7 2
-2 -3 3

Sample Output 2

Time to move my telescope!

Comments

There are no comments at the moment.