NEWH - New Horizons

I’m king of a house! And, what’s more, beyond that,

I’m king of a blueberry bush and a cat!

I’m Yertle the Turtle! Oh, marvellous me!

For I am the ruler of all that I see!"

Yertle has determined that the number of objects he can see, and hence rule, depends on the height of his throne. Your task, as Minister of Computing and Vertigo (a new combined Super Ministry), is to determine which objects Yertle would see should he build his throne to a particular height.

Input:

Standard input consists of:

A floating point number on a line by itself, specifying the diameter of Yertle’s planet in "flipper lengths".

A line containing three floating point numbers: the height of Yertle’s throne (in flipper lengths), the latitude of Yertle’s throne (between -90 and +90 degrees), the longitude of Yertle’s throne (between 0 and 360 degrees).

Several lines, each containing three floating point numbers and a string of alphabetic and space characters. Each line indicates the height, latitude, longitude and name of an object on the surface of Yertle’s planet. The last line is indicated by the end of standard input.

All distances are in flipper lengths, and all latitudes and longitudes are in degrees. Floating point values are formatted as a string of decimal digits with an optional decimal point and sign. The fields in the input are separated by exactly one space character. You may assume that no object hides another; only the horizon limits Yertle’s view.

Output:

Standard output consists of the list of objects whose tops are visible to Yertle, in alphabetical order.

Example Input:

20000.0

100.0 45.0 100.0

2.0 46.0 99.0 Cat

20.0 -45.0 260.0 House

5.0 45.1 100.2 Blueberry Bush

Example Output:

Blueberry Bush

Cat

 

 


Added by:Andres Tellez
Date:2011-08-23
Time limit:1s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64

hide comments
2011-09-15 02:29:01 [Trichromatic] XilinX
Resource: UVa 10153.
2011-08-28 14:49:48 Walrus
1) Please specify the limits.
2) The I/O is very frustrating, espcially with all those blank lines.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.