시간 제한메모리 제한제출정답맞힌 사람정답 비율
10 초 512 MB195865743.846%

문제

역사학자인 JOI 교수는 이전에 존재했던 IOI 왕국에 대해 연구하고 있다.

과거의 조사에 따르면, IOI 왕국은 세로 H 크기에 가로 W 크기이며, IOI 왕국의 수도는 방어를 위해 성벽으로 둘러싸여 있었다.

IOI 왕국의 수도를 둘러싸는 성벽은 다음과 같은 형태를 하고 있다:

  • 성벽의 크기 s(s ≥ 3)가 있다.
  • 크기 s의 성벽은 s × s의 정사각형 영역에서 안의 (s-2) × (s-2) 정사각형 영역을 제외한 테두리 모양을 하고 있다.

또 다른 조사에 의하면, 수도를 둘러싼 성벽의 크기는 L 이상이었다. 그리고 어떤 칸들에는 오래된 나무가 있는데, 나무가 있는 위치에는 성벽이 존재하지 않았음을 알고 있다.

JOI 교수는 이러한 사실들을 바탕으로 있을 수 있는 성벽의 가지 수를 알고 싶어한다. 이때, 성벽의 크기가 같더라도 위치가 다르면 서로 다른 성벽으로 간주한다.

IOI 왕국의 크기와, 성벽의 최소 크기, 그리고 나무의 위치들이 주어졌을 때 가능한 성벽의 가지 수를 구하는 프로그램을 작성하시오.

입력

입력의 첫 줄에는 정수 H, W, L, P가 공백으로 구분되어 주어진다. 이는 IOI 왕국의 크기가 세로 H, 가로 W이며 성벽의 최소 크기는 L, 나무의 개수가 P라는 뜻이다.

다음 P 개의 줄에 나무의 위치가 Ai, Bi가 공백으로 구분되어 주어진다. 이는 나무가 Ai번째 줄, Bi번째 칸에 있음을 의미한다.

출력

첫 줄에 가능한 성벽의 가지 수를 출력한다.

제한

  • 1 ≦ H, W ≦ 4 000
  • 3 ≦ L ≦ min(H, W)
  • 0 ≦ P ≦ 100 000
  • 1 ≦ Ai ≦ H (1 ≦ i ≦ P)
  • 1 ≦ Bi ≦ W (1 ≦i ≦ P)
  • (Ai, Bi) ≠ (Aj, Bj) (1 ≦ i < j ≦ P)

서브태스크

번호 배점 제한
1 4

H ≦ 500, W ≦ 500.

2 16

0 ≦ P ≦ 10.

3 80

추가적인 제약 조건이 없다.

예제 입력 1

5 5 3 2
2 2
4 3

예제 출력 1

4

1번 예제에서 가능한 성벽은 아래 4가지이다. 나무는 x로 표시되어있다.

예제 입력 2

7 8 4 3
2 2
3 7
6 5

예제 출력 2

13

예제 입력 3

4000 4000 1234 4
1161 3028
596 1892
3731 2606
702 1530

예제 출력 3

7050792912
W3sicHJvYmxlbV9pZCI6IjEwNzE3IiwicHJvYmxlbV9sYW5nIjoiMCIsInRpdGxlIjoiXHVjMTMxXHViY2JkIiwiZGVzY3JpcHRpb24iOiI8cD5cdWM1ZWRcdWMwYWNcdWQ1NTlcdWM3OTBcdWM3NzggSk9JIFx1YWQ1MFx1YzIxOFx1YjI5NCBcdWM3NzRcdWM4MDRcdWM1ZDAgXHVjODc0XHVjN2FjXHVkNTg4XHViMzU4IElPSSBcdWM2NTVcdWFkNmRcdWM1ZDAgXHViMzAwXHVkNTc0IFx1YzVmMFx1YWQ2Y1x1ZDU1OFx1YWNlMCBcdWM3ODhcdWIyZTQuPFwvcD5cclxuXHJcbjxwPlx1YWNmY1x1YWM3MFx1Yzc1OCBcdWM4NzBcdWMwYWNcdWM1ZDAgXHViNTMwXHViOTc0XHViYTc0LCBJT0kgXHVjNjU1XHVhZDZkXHVjNzQwIFx1YzEzOFx1Yjg1YyBIIFx1ZDA2Y1x1YWUzMFx1YzVkMCBcdWFjMDBcdWI4NWMgVyBcdWQwNmNcdWFlMzBcdWM3NzRcdWJhNzAsIElPSSBcdWM2NTVcdWFkNmRcdWM3NTggXHVjMjE4XHViM2M0XHViMjk0IFx1YmMyOVx1YzViNFx1Yjk3YyBcdWM3MDRcdWQ1NzQgXHVjMTMxXHViY2JkXHVjNzNjXHViODVjIFx1YjQ1OFx1YjdlY1x1YzJmOFx1YzVlYyBcdWM3ODhcdWM1YzhcdWIyZTQuPFwvcD5cclxuXHJcbjxwPklPSSBcdWM2NTVcdWFkNmRcdWM3NTggXHVjMjE4XHViM2M0XHViOTdjIFx1Yj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wic3VidGFzazMiOiI8cD5cdThmZmRcdTUyYTBcdTMwNmVcdTUyMzZcdTk2NTBcdTMwNmZcdTMwNmFcdTMwNDRcdWZmMGU8XC9wPlxyXG4iLCJzYW1wbGVfZXhwbGFpbl8xIjoiPHA+XHUzMDUzXHUzMDZlXHU1MTY1XHU1MjliXHU0ZjhiXHUzMDZlXHU1ODM0XHU1NDA4XHVmZjBjXHU1N2NlXHU1OGMxXHUzMDY4XHUzMDU3XHUzMDY2XHUzMDQyXHUzMDhhXHUzMDQ2XHUzMDhiXHUzMDgyXHUzMDZlXHUzMDZmXHU0ZWU1XHU0ZTBiXHUzMDZlIDQgXHU5MDFhXHUzMDhhXHUzMDRjXHU4MDAzXHUzMDQ4XHUzMDg5XHUzMDhjXHUzMDhiXHVmZjBlXHUzMDVmXHUzMDYwXHUzMDU3XHVmZjBjJnRpbWVzOyBcdTMwNjdcdTc5M2FcdTMwNTdcdTMwNWZcdTMwZGVcdTMwYjlcdTMwNmZcdTU3Y2VcdTU4YzFcdTMwNGNcdTViNThcdTU3MjhcdTMwNTdcdTMwNmFcdTMwNGJcdTMwNjNcdTMwNWZcdTMwNTNcdTMwNjhcdTMwNGNcdTMwOGZcdTMwNGJcdTMwNjNcdTMwNjZcdTMwNDRcdTMwOGJcdTMwZGVcdTMwYjlcdTMwNjdcdTMwNDJcdTMwOGJcdWZmMGU8XC9wPlxyXG5cclxuPHAgc3R5bGU9XCJ0ZXh0LWFsaWduOiBjZW50ZXI7XCI+PGltZyBhbHQ9XCJcIiBzcmM9XCJcL3VwbG9hZFwvaW1hZ2VzM1wvcmFuLnBuZ1wiIHN0eWxlPVwid2lkdGg6IDM3OHB4OyBoZWlnaHQ6IDM3M3B4O1wiIFwvPjxcL3A+XHJcbiJ9XQ==

출처

Olympiad > Japanese Olympiad in Informatics > JOI 2015 5번

  • 문제를 번역한 사람: myungwoo
  • 문제의 오타를 찾은 사람: yclock

채점 및 기타 정보

  • 예제는 채점하지 않는다.