Score : 500 points
There are N cards. The i-th card has an integer A_i written on it. For any two cards, the integers on those cards are different.
Using these cards, Takahashi and Aoki will play the following game:
You are given Q candidates for the value of x: X_1, X_2, ..., X_Q. For each i (1 \leq i \leq Q), find the sum of the integers written on the cards that Takahashi will take if Aoki chooses x = X_i.
Input is given from Standard Input in the following format:
N Q A_1 A_2 ... A_N X_1 X_2 : X_Q
Print Q lines. The i-th line (1 \leq i \leq Q) should contain the answer for x = X_i.
5 5 3 5 7 11 13 1 4 9 10 13
31 31 27 23 23
For example, when x = X_3(= 9), the game proceeds as follows:
Thus, 13 + 11 + 3 = 27 should be printed on the third line.
4 3 10 20 30 40 2 34 34
70 60 60