#P15729. [JAG 2024 Summer Camp #2] Add Add Add
[JAG 2024 Summer Camp #2] Add Add Add
Description
You are given two sequences of positive integers of length , and . For , compute the value of , that is, the sum of for all indices such that and .
Input Format
The input is given in the following format:
$$\begin{aligned} &N \\ &A_1 \ A_2 \ \ldots \ A_N \\ &B_1 \ B_2 \ \ldots \ B_N \end{aligned}$$- ()
- All input values are integers.
Output Format
Output lines. On the -th line (), output the answer for the case where .
3
1 1 1
1 1 1
2
6
12
16
18
5
3 7 1 8 3
7 10 5 3 4
10
37
70
114
165
206
230
248
255
1
3
5
8
京公网安备 11011102002149号