#P465. 【例84.2】分香蕉

【例84.2】分香蕉

Description

It's harvest season again, and nn bananas have ripened on Flower Fruit Mountain, each with a mass of aia_i. Garlic Head has mm monkeys, each with a weight of bib_i. The monkeys eat bananas in a specific order, taking bananas one by one according to their weight from largest to smallest. When one round is complete, if there are still bananas left, they will continue taking them one by one until all bananas are gone. Each monkey is very smart and will choose the banana with the largest mass each time.
Now the question is: what is the total mass of bananas each monkey will receive in the end?

Input Format

The first line contains two integers nn, mm (1n,m1051 ≤n, m ≤ 10^5).
The second line contains nn integers aia_i (1<ai1041 <a_i≤10^4), representing the mass of each banana.
The third line contains mm integers bib_i (1<bi1091 <b_i≤10^9), representing the weight of each monkey, guaranteed to be unique.

Output Format

A single line containing mm space-separated integers, representing the total mass of bananas each monkey receives.

Sample

5 3
1 2 3 4 5
3 2 1
7 5 3