405679: GYM102035 C Apple Shops
Description
Ayoub wants to buy k boxes of apples, and there are n shops where he can buy apples from. The price of one box of apples in the ith shop equals to pi.
It is obvious that Ayoub should go to the shop with the minimal price per box. When the government saw everyone buying from the same shop, they made a special rule so that people will buy from different shops.
The cost of buying the jth apple box from the ith shop is equal to pi + (j - 1) × x
For example, if the price of one box from a specific shop is 5 and x = 3. If you want to buy 3 boxes, you will pay 5 money on the first box and 5 + x on the second box, and 5 + 2 × x on the third box, in total paying 5 + 8 + 11 = 24.
Now you should tell Ayoub how many boxes he should buy from every shop so that the total money he will pay is minimized.
InputFirst line contains 3 integers n k x (1 ≤ n ≤ 105) (1 ≤ k, x ≤ 109) which are the number of shops and the number of box Ayoub wants to buy and the amount of money you should pay more after buying a box from a specific shop.
Second line contains n integers, the ith one is pi (1 ≤ pi ≤ 109) which is the price of a box of apples from the ith shop.
OutputYou should print n integers, the ith one should be the number of box Ayoub should buy from the ith shop.
Make sure that the amount of money will be payed will be minimized as possible.
If there are more than one answer you can print any of them.
ExamplesInput3 2 5Output
2 2 2
1 1 0Input
4 4 3Output
1 5 2 3
2 0 1 1Note
In the second sample Ayoub will pay 1 and 4 to the first shop and will pay 2 to the third shop and will pay 3 to the fourth shop, in total he will buy 10 money.