#P2392. kkksc03考前临时抱佛脚
kkksc03考前临时抱佛脚
Description
For this final exam, kkksc03 needs to take subjects. Therefore, he begins practicing problem sets. Each subject has a problem set with problems, and each problem takes some (possibly different) amount of time to complete (, , , ).
kkksc03 has an ability: his left and right brains can work on different problems simultaneously, but only within the same subject. Therefore, kkksc03 must review one subject at a time.
Since kkksc03 is also in a hurry to handle Luogu's bugs, he wants to finish as quickly as possible. He wants to know the minimum time required to complete all the review.
Input Format
This problem contains lines of input.
- The first line contains four positive integers .
- The second line contains , a total of numbers, representing the time required for each problem in the first subject's problem set.
- The third line contains , a total of numbers.
- The fourth line contains , a total of numbers.
- The fifth line contains , a total of numbers, with the same meaning as above.
Output Format
Output one line: the minimum time to finish all the review.
1 2 1 3
5
4 3
6
2 4 3
20
Hint
.
$1\leq A_1,A_2,\ldots,A_{s_1},B_1,B_2,\ldots,B_{s_2},C_1,C_2,\ldots,C_{s_3},D_1,D_2,\ldots,D_{s_4}\leq 60$.
Translated by ChatGPT 5
京公网安备 11011102002149号