Loading repovive.com/contests/9/problems/C
You are given two arrays and .
In each operation you can choose two numbers and such that:
Then for every , swap with .
Find the maximum sum of array after any number of operations (including zero).
An operation on segment will swap and , resulting in with sum equal to 5.
An operation on segment will swap and , resulting in with sum equal to 24.
One operation on segment will result in . Another operation on segment will result in with sum equal to 22.