Loading [MathJax]/jax/output/CommonHTML/jax.js

The Number of Windows

For a given array a1,a2,a3,...,aN of N elements and Q integers xi as queries, for each query, print the number of combinations of two integers (l,r) which satisfies the condition: 1lrN and al+al+1+...+ar1+arxi.

Constraints

Input

The input is given in the following format.

N Q
a1 a2 ... aN
x1 x2 ... xQ

Output

For each query, print the number of combinations in a line.

Sample Input 1

6 5
1 2 3 4 5 6
6 9 12 21 15

Sample Output 1

9
12
15
21
18