## CCC '00 S5 - Sheep and Coyotes

View as PDF

Points:10
Time limit:2.0s
Memory limit:16M

Problem type

##### Canadian Computing Competition: 2000 Stage 1, Senior #5

A square by field contains several sheep. A coyote enters the field at some point in the south boundary and proceeds to eat the sheep closest to the point of entry, picking arbitrarily if more than one sheep is equally close. The coyote, being sated, then leaves the field.

Your job is to determine which sheep may be eaten by the coyote.

Assume that the southwest corner of the field is located at , the northwest corner at , the northeast corner at and the southeast corner at .

#### Input Specification

The first line of input gives the number of sheep, between and . For each sheep a pair of lines follows, giving its coordinates within the field (between and ).

#### Output Specification

For each sheep that might be eaten print a line The sheep at (x, y) might be eaten. where and give the location of the sheep to two decimal places. The sheep can be listed in any order in the output.

#### Sample Input

6
100.00
100.00
200.00
150.00
140.00
200.00
100.00
300.00
300.00
300.00
300.00
100.00

#### Sample Output

The sheep at (100.00, 100.00) might be eaten.
The sheep at (300.00, 100.00) might be eaten.

• septence123
commented on Feb. 7, 2017
MLE?

when I submit in PyPy2 I get MLE, even though it only uses around 5 mb when I submit it in python2? any reason for this?

• Xyene
commented on Feb. 8, 2017

Yes, the memory limit for this problem is 16M, and even a hello world program uses 30M in PyPy. That's the trade-off between performance and memory usage.

• onlyIfStatement
commented on Jan. 3, 2017
Float Precision Error?

Is case 5 testing for a precision error or am i making another mistake?