Max Ai+Bj
You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.
Problem Statement
You are given two integer sequences and , each of length . Choose integers to maximize the value of .
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the maximum possible value of .
Sample Input 1
2
-1 5
3 -7
Sample Output 1
8
For , the values of are respectively, and achieves the maximum value .
Sample Input 2
6
15 12 3 -13 -1 -19
7 17 -13 -10 18 4
Sample Output 2
33
SDNU_ACM_ICPC_2024_WEEKLY_PRACTICE_1st
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 8
- Start at
- 2024-10-27 18:30
- End at
- 2024-10-27 21:30
- Duration
- 3 hour(s)
- Host
- Partic.
- 39