#C. 半透明骨牌覆盖

    Type: Default 1000ms 256MiB

半透明骨牌覆盖

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Background

初一竞赛组期末考题

Description

给定一个2n2*n的数字矩阵,用nn个一半黑色一半透明的121*2骨牌将矩阵全部覆盖,骨牌不能有重叠,不能有数字不被覆盖。此时有nn个数被黑色盖住,另外nn个数可以看见。求可以看见的数字的和的最大值。

Format

Input

第一行一个正整数nn,第二行nn个数为矩阵第一行,第三行nn个数为矩阵第二行。

Output

一个正整数表示最大和。

Samples

3
4 2 1
4 2 1
9
3
4 3 1
4 3 1
10

Limitation

对20%的数据,n100n≤100

对50%的数据,n10000n≤10000

对100%的数据,3n31053≤n≤3*10^5,矩阵中所有元素的值非负且不超过10910^9

1s, 1024KiB for each test case.

2024-2025第一学期初一竞赛组期末考

Not Attended
Status
Done
Rule
IOI
Problem
4
Start at
2024-12-24 14:30
End at
2024-12-27 10:24
Duration
1.5 hour(s)
Host
Partic.
43