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 (xA,yA), (xB,yB), and (xC,yC) and their magnitudes are mA, mB, and mC 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

1R100
100xA,yA,xB,yB,xC,yC,X,Y100
100mA,mB,mC100

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, xA, yA, and mA.
The third line will contain three space-separated integers, xB, yB, and mB.
The final line will contain three space-separated integers, xC, yC, and mC.

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

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

Sample Output 1

Copy
What a beauty!

Sample Input 2

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

Sample Output 2

Copy
Time to move my telescope!

Comments

There are no comments at the moment.