n dishes on the table, shared between two tasters so that each dish goes to exactly one of them. If the first taster eats dish i, it earns first[i] points; if the second one does, it earns second[i] points.
The first taster must try exactly first_count dishes, and the second takes all the rest. Return the largest possible total score.first=[5, 2, 8, 3], second=[1, 6, 4, 3], first_count=2 → 22
The first taster gets dishes 0 and 2 (5 + 8), the second gets 1 and 3 (6 + 3). Total: 22.
first=[4, 4, 4], second=[9, 1, 7], first_count=0 → 17
The first taster gets nothing, so the second takes everything: 9 + 1 + 7 = 17.
first=[3, 10], second=[7, 2], first_count=2 → 13
first_count ≤ nfirst=[5, 2, 8, 3], second=[1, 6, 4, 3], first_count=2
22
Run checks the first 3 tests in your browser. Submit checks all 96 tests on the server, hidden ones included.