Kilani will give you two arrays, array $$$a$$$ with size $$$n$$$ which all its elements are positive integers, and an array $$$b$$$ with size $$$m$$$ which all its elements are negative integers.
You will have to make a new array $$$c$$$ with size $$$n+m$$$, such that:
Can you tell Kilani what is the maximum subarray sum of the array $$$c$$$?
In the first line you will be given $$$n$$$ and $$$m$$$, where $$$(1\le n,m \le 2 \cdot 10^5)$$$.
In the second line you will be given $$$n$$$ integers as the array $$$a$$$, where $$$(1\le a_i \le 10^9)$$$.
In the third line you will be given $$$m$$$ integers as the array $$$b$$$, where $$$(-1\le b_i \le -10^9)$$$.
Print one integer, the maximum subarray sum of the array $$$c$$$.
4 4 1 1 1 1 -1 -1 -1 -1
1
7 5 4 8 20 7 1 4 9 -13 -3 -17 -2 -5
20
| Contests - ACM Student Chapter - PSUT |
|---|
| Закрытая |
| Зритель |
| PSUT Individual |
|---|
| Закончено |
| Название |
|---|


