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 .
The input is given in the following 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