Music Notes I
GJ will teach your cows how perform a song. The song consists of notes, and ith note lasts times. Cows begin to perform the song at time 0; therefore touch them note 1 from time 0 to time , the note 2 from time to time etc.
Cows have lost interest in the song, because they feel it is long and boring.Therefore, to be sure that their cows are paying attention, GJ makes them questions of form,During the time ( song length) what notes should be playing?. The cows need your collaboration to answer these questions.
As an example, consider a song with these specifications: the note 1 lasts 2 times, the note 2 lasts 1 time and the note 3 lasts 3 times.
NOTE 1 1 2 3 3 3
+--+--+--+--+--+--+
TIME 0 1 2 3 4 5
Input specification
Line 1: Two space-separated integers N and Q.
Lines 2 .. N+1: The line contains a single integer .
Lines N + 2 .. : The line contains a single integer .
Output specification
The answer to each question.
Sample input
3 5
2
1
3
2
3
4
0
1
Sample output
2
3
3
1
1
Comments