#P10771. [NOISG 2021 Qualification] Competition
[NOISG 2021 Qualification] Competition
Problem Description
You are a teacher with students. Each student has a Physics score and a Biology score . You need to choose students to participate in the Physics competition and students to participate in the Biology competition. Each student must participate in exactly one competition.
Define your school's strength value as the sum of the Physics scores of those who participate in the Physics competition and the Biology scores of those who participate in the Biology competition. Find the maximum possible strength value.
Input Format
The first line contains three integers .
The second line contains integers .
The third line contains integers .
Output Format
Output one integer in one line: the maximum strength value.
3 1 2
5 3 4
7 1 4
14
5 3 2
5 6 6 5 1
0 0 0 0 0
17
Hint
Explanation for Sample 1
The 1st and 3rd students participate in the Biology competition, and the 2nd student participates in the Physics competition.
Constraints
This problem uses bundled testdata.
Subtask0 is the sample.
Subtask1 (29 pts): .
Subtask2 (22 pts): it is guaranteed that all .
Subtask3 (49 pts): no special constraints.
It is guaranteed that , , , and .
Translated by ChatGPT 5