CF302B Eugeny and Play List
Description
Eugeny loves listening to music. He has $ n $ songs in his play list. We know that song number $ i $ has the duration of $ t_{i} $ minutes. Eugeny listens to each song, perhaps more than once. He listens to song number $ i $ $ c_{i} $ times. Eugeny's play list is organized as follows: first song number $ 1 $ plays $ c_{1} $ times, then song number $ 2 $ plays $ c_{2} $ times, $ ... $ , in the end the song number $ n $ plays $ c_{n} $ times.
Eugeny took a piece of paper and wrote out $ m $ moments of time when he liked a song. Now for each such moment he wants to know the number of the song that played at that moment. The moment $ x $ means that Eugeny wants to know which song was playing during the $ x $ -th minute of his listening to the play list.
Help Eugeny and calculate the required numbers of songs.
Input Format
The first line contains two integers $ n $ , $ m $ $ (1
Output Format
Print $ m $ integers — the $ i $ -th number must equal the number of the song that was playing during the $ v_{i} $ -th minute after Eugeny started listening to the play list.