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

27153번 - Achluphobic Angus 다국어채점 준비 중

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

문제

Bessie's newest calf, Calfbert, has become achluophic; Calfbert is afraid of the dark. Bessie has decided light up the entire field so Calfbert will be able to go to sleep. Farmer John has already set up lamps in his field which light it completely, but, being an environmentally friendly cow, Bessie wishes to use as few of these lamps as possible.

Farmer John's field is a rectangular grid that has lamps in some of the squares of the grid. Each lamp, when lit, illuminates a 3x3 region (9 squares total) with the center being the actual location of the lamp. The light from some lamps spills outside the field, with no effect one way or the other. No square contains more than one lamp.

Your job is to find the minimal number of lamps that will still light every square of the entire field.

입력

  • Line 1: three integers:
    • R, 1 ≤ R ≤ 24, the number of rows in the field
    • C, 1 ≤ C ≤ 24, the number of columns in the field
    • L, 1 ≤ L ≤ 256, the number of lamps
  • Lines 2..L+1: two integers, LR & LC, that represent row and column respectively of a lamp's location

출력

The output is a single line that contains one integer that is the minimum number of lit lamps required to illuminate each square in the field.

제한

예제 입력 1

5 8 7
2 2
4 2
2 4
3 4
4 4
2 7
4 7

예제 출력 1

6

힌트

출처

Olympiad > USA Computing Olympiad > 2000-2001 Season > USACO Fall 2000 Contest > Green 4번

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

출처

대학교 대회

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

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