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

30452번 - Server Overload 다국어

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

문제

The IT team of a SY company manages the sever log data. This log data is organized into an $n \times n$ grid, with each cell storing a number indicating the server access count during a specific time period. The server has recently been overloaded and is at risk of going down. To determine the cause of the server overload, the IT team uses a specialized 1ドル \times 3$ analysis tool to find the sub-grids of $n \times n$ grid that represent the high access counts. The 1ドル \times 3$ analysis tool covers some 1ドル \times 3$ sub-grid (of the $n \times n$ grid) of vertical length of 1ドル$ and of horizontal length of 3ドル$. The tool reports the sum of access counts stored in the cells of the sub-grid that the tool covers. The only limitation is that you can use this analysis tool at most $k$ times and the 1ドル \times 3$ sub-grids covered by the tool should not overlap.

Given an $n \times n$ grid and a positive integer $k,ドル write a program that outputs the maximum of the total sum of access counts stored in cells of the $n \times n$ grid covered by the 1ドル \times 3$ analysis tool, such that the tool is used at most $k$ times and no 1ドル \times 3$ sub-grids covered by the tool overlap.

입력

Your program is to read from standard input. The input starts with a line containing two integers, $n$ and $k$ (3ドル ≤ n ≤ 1,000円,ドル 1ドル ≤ k ≤ 5,000円$), where $n$ represents the size of the grid and $k$ is the maximum number of times that the analysis tool can be used. In the following $n$ lines, access count values of the $n \times n$ grid are given; the $i$-th line contains $n$ access count values (from the first column to the last column) of the $i$-th row of the grid. All these access count values are integers between 1ドル$ and 1ドル,000円,000円,000円$.

출력

Your program is to write to standard output. Print exactly one line. The line should contain the maximum of the total sum of access counts in cells covered by the analysis tool such that the tool can be used at most $k$ times and no 1ドル \times 3$ sub-grids covered by the tool overlap.

제한

예제 입력 1

5 2
1 2 3 1 2
3 4 2 5 6
2 4 2 3 5
5 4 3 2 5
6 5 4 3 5

예제 출력 1

28

예제 입력 2

6 3
1 2 3 1 2 1
3 4 2 5 6 2
2 4 2 3 5 5
8 8 8 8 8 8
9 9 9 9 9 1
1 2 1 2 3 1

예제 출력 2

75

힌트

출처

ICPC > Regionals > Asia Pacific > Korea > Nationwide Internet Competition > Seoul Nationalwide Internet Competition 2023 J번

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

출처

대학교 대회

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

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