That's enough. There's no need to bring Genshin Impact into every little matter. Genshin Impact hasn't done anything to offend or harm you. Why do you keep mindlessly bashing it? miHoYo puts a lot of effort into promoting Chinese culture through their games, and all you do is sit behind a keyboard and criticize a conscientious company. People like you are ruining the future of Chinese games.
Now, the Traveler has nnn boxes in their possession, some of which have lids that can be shifted left or right by at most one step. If the iii-th box is covered with a lid, you gain aia_iai score.(Covering it with multiple lids still gets only aia_iai score.) Determine the maximum total game score achievable by covering boxes with lids after shifting serveral(possibly, zero) lids.
输入格式
The first line contains a integer, nnn(1≤n≤1061 \leq n \leq 10^61≤n≤106), representing the number of boxes.
The second line contains nnn integers, where the iii-th integer aia_iai (0≤ai≤1090 \leq a_i \leq 10^90≤ai≤109) represents the value of iii-th box.
The third line contains nnn integers, where the iii-th integer bib_ibi (0≤bi≤10 \leq b_i \leq 10≤bi≤1) represents whether iii-box has a lid. bi=0b_i=0bi=0 means there is no lid on the box.