Logo
(追記) (追記ここまで)

24767번 - Beehives 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB19211910270.345%

문제

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.

제한

예제 입력 1

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

예제 출력 1

2 sour, 1 sweet
4 sour, 0 sweet

힌트

출처

School > Virginia Tech High School Programming Contest > 2014 Virginia Tech High School Programming Contest C번

  • 문제를 만든 사람: Nicholas Sharp
(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /