Shotgun [two-dimensional prefixes and]

Source: Internet
Author: User

In clyz, there was a very powerful gunman called dongge. His goddess QY was kidnapped by a famous gang boss XXX. dongge was eager to retrieve QY, I bought several weapons from the chair. He chose a shotgun because he had to open the clyz door first. Clyz's door is composed of N * m stones, while dongge's volume is column C in the r row (dongge cannot be cut). He wants to save bullets, he can only make a hole that he just exists. The value of each rock is different, and the money he can get is different. dongge wants to save money to buy weapons, so we have to choose a part of the rock that has the greatest value. Now he wants to know how much money he can get to buy the next weapon.

Input Format

Row 3: four positive integers n, m, R, c

2nd. n + 1 row: M positive integers in each row. The number of J in the I + 1 row indicates num [I] [J].

Output Format

Row 1st: an integer that represents the maximum amount of money that dongge can obtain.

Input example

3 5 2 3

5 2 7 1 1

5 9 5 1 5

3 5 1 5 3

Output example

33

Data range

 

60% of data: 1 <= n, m <= 200

100% of data: 1 <= n, m <= 1,000

1 <= r <= N, 1 <= C <= m

1 <= num [I] [J] <= 1000

Ensure that the results do not exceed 2,000,000,000

 

Shotgun [two-dimensional prefixes and]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.