Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are going to eat X yellow banana and Y green banana. image You have : A yellow banana of deliciousness p1,p2,,pA. B green banana
You are going to eat X yellow banana and Y green banana.
image
You have :
A yellow banana of deliciousness p1,p2,,pA.
B green banana of deliciousness q1,q2,,qB.
C colorless banana of deliciousness r1,r2,,rC.
Before eating a colorless banana, you can paint it yellow or green, and it will count as a yellow or green banana, respectively.
From the bananas above, you will choose the bananas to eat while making the sum of the deliciousness of the eaten bananas as huge as possible.
Find the maximum possible sum of the deliciousness of the eaten bananas that can be achieved when optimally coloring zero or more colorless bananas.
Input Format
X Y A B C
p1 p2 ... pA
q1 q2 ... qB
r1 r2 ... rC
Constraints
. 1 X A 10^5
. 1 Y B 10^5
. 1 C 10^5
. 1 pi 10^9
. 1 qi 10^9
. 1 ri 10^9
All values in input are integers.
Output Format
Print the maximum possible sum of the deliciousness of the eaten bananas.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started