시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 | 1024 MB | 133 | 74 | 59 | 65.556% |
Bill the beekeeper has a problem! His bees like to fight with each other instead of producing honey. If the bees fight each other, then the honey turns out sour. The only way to stop the bees from fighting and keep the honey sweet is to ensure that the hives are not too close together. Help Bill figure out how many of this season's hives will produce sour honey.
Bill's hives all exist on a plane, and he knows some distance d such that two hives within d of each other will fight, and both will produce sour honey. If a hive does not fight with any other hives, it produces sweet honey. Given d and the positions of N beehives, output how many hives will produce sweet honey and how many hives will produce sour honey.
Input will be provided on multiple lines. Each case will begin with a floating point number d (0 < d < 1000.0), the distance within which hives will fight. On the next line will be N (1 ≤ N ≤ 100), the number of hives in that case. The next N lines will contain two floating point numbers separated by a single space, x and y (-1000.0 ≤ x,y ≤ 1000.0), which give the position of each hive. No two hives will be at the exact same location. Input will be terminated by a line containing the string 0.0 0
.
For each case output a line of the following form: a sour, b sweet
where a
and b
are the number of hives producing sour and sweet honey, respectively.
10.0 3 3.0 3.0 3.5 4.5 20.0 20.0 5.0 4 2.0 1.0 2.0 4.0 2.0 8.0 2.0 12.0 0.0 0
2 sour, 1 sweet 4 sour, 0 sweet
High School > Virginia Tech High School Programming Contest > 2014 Virginia Tech High School Programming Contest C번