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

9908번 - Carpet 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 1024 MB60534887.273%

문제

Given a rectangular configuration representing a floor plan, where ‘#’ indicates a pillar and ‘.’ a clear space:

...#...#..
..##.#....
......#.#.
.#........
.........#
.....#.#..

What is the area (number of dots) of the largest rectangular carpet whose edges are parallel to the boundary of the floor that can be laid on this piece of land? For the example above, the largest carpet is represented with ‘*’ symbols:

...#...#..
..##.#....
......#.#.
.#*******.
..*******#
.....#.#..

The area of this carpet is 14.

The rows are numbered from top to bottom starting from row 1, and the columns are numbered from left to right starting from column 1. You can assume that there are at most 20 rows and at most 40 columns.

입력

The input consists of the following lines:

  1. The first line contains 2 integers indicating the number of rows and number of columns of the floor plan, respectively.
  2. The second line consists of a positive integer n indicating the number of pillars.
  3. Each of the subsequent n lines consists of the position of a pillar, represented as 2 integers separated by a space. The first integer represents the row number and the second integer represents the column number.

출력

The output contains a single integer value, which is the area of the largest carpet that can be laid on the floor.

제한

예제 입력 1

6 10
11
1 4
1 8
2 6
5 10
4 2
2 4
2 3
6 6
3 7
3 9
6 8

예제 출력 1

14

힌트

출처

Olympiad > National Olympiad in Informatics (Singapore) > NOI 2002 2번

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

출처

대학교 대회

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

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