#P7675. [COCI 2013/2014 #5] DOMINE
[COCI 2013/2014 #5] DOMINE
Description
You are given an board with numbers written on it. You have dominoes. Please find the maximum possible sum of the numbers on the board that can be covered using these dominoes.
Input Format
The first line contains two integers and , representing the number of rows of the board and the number of dominoes.
The next lines each contain integers, representing the numbers on the board.
Output Format
Output one integer, representing the maximum sum of the numbers on the board that can be covered by these dominoes.
5 3
2 1 -1
1 3 2
0 2 3
2 1 1
3 3 0
16
2 2
0 4 1
3 5 1
13
Hint
[Sample Explanation #1]

As shown in the figure, the sum is . It can be proven that this is the maximum.
[Constraints]
For of the testdata, .
[Notes]
The scoring of this problem follows the original COCI problem settings, with a full score of .
This problem is translated from COCI2013_2014 CONTEST #5 T4 DOMINE.
Translated by ChatGPT 5
京公网安备 11011102002149号