10214_ARectangularBarn

2022-5-16 18:16| 发布者: Hocassian| 查看: 62| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-3-89504665867399-Problem List-采集的数据-后羿采集器.html

Pro.ID

10214

Title

A Rectangular Barn

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=10214

AC

17

Submit

45

Ratio

37.78%

时间&空间限制

  • Time Limit: 4000/2000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    Ever the capitalist, Farmer John wants to extend his milking business by purchasing more cows. He needs space to build a new barn for the cows.

    FJ purchased a rectangular field with R (1 ≤ R ≤ 3,000) rows numbered 1..R and C (1 ≤ C ≤ 3,000) columns numbered 1..C. Unfortunately, he realized too late that some 1 × 1 areas in the field are damaged, so he cannot build the barn on the entire R × C field.

    FJ has counted P (0 ≤ P ≤ 30,000) damaged 1 × 1 pieces and has asked for your help to find the biggest rectangular barn (i.e., the largest area) that he can build on his land without building on the damaged pieces.

    输入

    Line 1:   Three space-separated integers: R, C, and P.

    Lines 2..P+1:   Each line contains two space-separated integers, r and c, that give the row and column numbers of a damaged area of the field

    输出

    Description

    Ever the capitalist, Farmer John wants to extend his milking business by purchasing more cows. He needs space to build a new barn for the cows.

    FJ purchased a rectangular field with R (1 ≤ R ≤ 3,000) rows numbered 1..R and C (1 ≤ C ≤ 3,000) columns numbered 1..C. Unfortunately, he realized too late that some 1 × 1 areas in the field are damaged, so he cannot build the barn on the entire R × C field.

    FJ has counted P (0 ≤ P ≤ 30,000) damaged 1 × 1 pieces and has asked for your help to find the biggest rectangular barn (i.e., the largest area) that he can build on his land without building on the damaged pieces.

    Input

    Line 1:   Three space-separated integers: R, C, and P.

    Lines 2..P+1:   Each line contains two space-separated integers, r and c, that give the row and column numbers of a damaged area of the field

    Output

    Line 1:  The largest possible area of the new barn

    Sample Input

    3 4 2
    1 3
    2 1

    Sample Output

    6

    Hint

    OUTPUT DETAILS

     1 2 3 4
     +-+-+-+-+
    1| | |X| |
     +-+-+-+-+
    2|X|#|#|#|
     +-+-+-+-+
    3| |#|#|#|
     +-+-+-+-+

    Pieces marked with 'X' are damaged and pieces marked with '#' are part of the new barn.

    Source

    样例输入

    3 4 2
    1 3
    2 1

    样例输出

    6

    提示

    OUTPUT DETAILS

     1 2 3 4
     +-+-+-+-+
    1| | |X| |
     +-+-+-+-+
    2|X|#|#|#|
     +-+-+-+-+
    3| |#|#|#|
     +-+-+-+-+

    Pieces marked with 'X' are damaged and pieces marked with '#' are part of the new barn.


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部