시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
1 초 (추가 시간 없음) | 256 MB | 3 | 3 | 3 | 100.000% |
Pang believes that one cannot make an omelet without breaking eggs.
For a subset $A$ of $\{1,2,\ldots,n\}$, we calculate the score of $A$ as follows:
Find the maximum possible score over the choice of $A$.
The first line contains a single integer $n$ $(1\le n\le 100000)$.
The second line contains $n$ integers $a_1,a_2,\ldots,a_n$ $(1\le a_i\le 1000000000)$.
The third line contains $n$ integers $b_1,b_2,\ldots,b_n$ $(1\le b_i\le 1000000000)$.
Print a single integer $x$ --- the maximum possible score.
4 1 1 1 2 1 1 1 1
4
4 1 1 1 1 1 1 1 2
3