cho.sh
Notes
Loading...

Song Scores

Time limit

2s

Memory limit

128 MB

Problem

Hyunsu is teaching students a song. The song consists of N scores, and the i-th score lasts Bi seconds. The students start singing along with score 1 at time 0. Therefore, they sing score 1 from second 0 through second B1-1, and score 2 from second B1 through second B1+B2-1.

Score112333
Time012345

You are given Q times T1, T2, ..., TQ. For each time Ti, output the number of the score the students are singing at that second, in query order.

Input

The first line contains the number of scores N (1 ≤ N ≤ 100) and the number of queries Q (1 ≤ Q ≤ 1,000). Each of the next N lines contains one integer: the duration in seconds of one score, from score 1 through score N. Each duration is an integer no greater than 100. Each of the next Q lines contains one queried time in seconds. Each queried time is also an integer.

Output

Print Q lines. For the 1st through Q-th queries, print the number of the score being sung at the corresponding time.