Pastry shop

손님이 정렬된 도착 시간으로 오고 파이 하나를 굽는 데 정해진 시간이 걸릴 때, 각 오븐 모델마다 최소 총 대기 시간을 구한다.

어려움9그리디정렬이분 탐색수학아직 제출이 없습니다시간 제한2초메모리 제한128 MB

문제

You are the owner of a pastry shop baking the most delicious pies in town. Everyday, you sell them to nn customers -- the ii-th of them comes at time t_it\_i (but you can begin baking a pie at time 0). Every client, after coming to your shop waits until you serve him his favourite pie straight out of the oven. Nobody likes cold pies, so a customer may wait for a pie, but a pie should not wait for a customer. 

Your oven can bake only one pie at once and cannot be opened during the process. It always takes the same time to bake a pie. Owing to the fact that you know in advance the exact arrival time of each customer, you have optimized your baking schedule in such a way, that the total waiting time of customers is minimal.

However, your current oven is quite worn out and and it's high time to think about buying a new one. You have already done some research and have selected mm models which are of interest to you. The most important parameter of each oven is the duration of baking a single pie -- for the ii-th model this duration equals d_id\_i. Of course you would like to have the most time-efficient oven, but you are not sure whether your wallet allows for such a luxury.

To make a rational decision, you would like to gather some useful statistics. For each model, compute the total amount of time your customers would wait, if you decided to purchase that oven and scheduled your baking optimally.

입력

The first line contains two integers nn and mm (1n,m200,0001 \leq n, m \leq 200\\,000) which are the number of customers and oven models, respectively. The second line contains nn integers t_1,t_2,t_nt\_1, t\_2 \ldots, t\_n (0t_1t_2t_n10120 \leq t\_1 \leq t\_2 \leq \ldots \leq t\_n \leq 10^{12}); t_it\_i stands for the moment of arrival of the ii-th client. Please note that two customers can come to your shop at the same time. In the third line there are mm integers d_1,d_2,,d_md\_1, d\_2, \ldots, d\_m (1d_i1061 \leq d\_i \leq 10^6); d_id\_i stands for the duration of baking a single pie in the ii-th oven model.

출력

You should output exactly mm lines; the ii-th of them should contain exactly one integer -- the minimum total time your customers would wait with optimal baking schedule, assuming you decided to purchase the ii-th oven model.