Suppose that you pick number a from the principal pack and number b from the subsequent sack. Then, at that point, you eliminate b from the subsequent sack and supplant a with a−b in the main pack. Note that assuming there are various events of these numbers, you will just eliminate/supplant
Correct answer will be upvoted else Multiple Downvoted. Computer science.
Suppose that you pick number a from the principal pack and number b from the subsequent sack. Then, at that point, you eliminate b from the subsequent sack and supplant a with a−b in the main pack. Note that assuming there are various events of these numbers, you will just eliminate/supplant precisely one event.
You need to play out these tasks so that you have precisely one number excess in precisely one of the packs (the other two sacks being unfilled). It very well may be shown that you can generally apply these tasks to get such a design eventually. Among this multitude of setups, track down the one which has the greatest number left eventually.
Input
The principal line of the input contains three space-isolated integers n1, n2 and n3 (1≤n1,n2,n3≤3⋅105, 1≤n1+n2+n3≤3⋅105) — the number of numbers in the three packs.
The I-th of the following three lines contain ni space-isolated integers
Output
Print a solitary integer — the most extreme number which you can accomplish eventually.

Step by step
Solved in 4 steps with 1 images









