#ABC208C. [ABC208C] Fair Candy Distribution

    ID: 1184 Type: RemoteJudge 2000ms 1024MiB Tried: 0 Accepted: 0 Difficulty: (None) Uploaded By: Tags>基础语法输入输出一重循环基础算法排序

[ABC208C] Fair Candy Distribution

提示:该题测试数据补录中,暂不支持评测提交。

No testdata at current.

No submission language available for this problem.

Score : 300300 points

Problem Statement

There are NN citizens in the Kingdom of Takahashi. Each citizen has a national ID number; the ID of the ii-th citizen is aia_i. Here, all aia_i are pairwise different.

Takahashi has KK pieces of sweets. He has decided to hand out these pieces to the citizens in the following way until he has no more pieces.

  • When he has NN or more pieces, hand out one piece to every citizen.
  • Otherwise, let K′K' be the number of pieces he has at the moment, and hand out one piece to each of the citizens with the K′K' smallest IDs.

When all pieces are handed out, how many pieces will the ii-th citizen have?

Constraints

  • 1≤N≤2×1051 \leq N \leq 2 \times 10^5
  • 1≤K≤10181 \leq K \leq 10^{18}
  • 1≤ai≤1091 \leq a_i \leq 10^9
  • All aia_i are pairwise different.
  • All values in input are integers.

**## Input

Input is given from Standard Input in the following format:

NN KK

a1a_1 a2a_2 …\ldots aNa_N

Output

Print NN lines. The ii-th line should contain the number of pieces of sweets received by the ii-th citizen.**

2 7
1 8
4
3

Takahashi will hand out the pieces as follows.

  • Hand out one piece to everyone, leaving Takhashi with 55 pieces.
  • Hand out one piece to everyone, leaving Takhashi with 33 pieces.
  • Hand out one piece to everyone, leaving Takhashi with 11 piece.
  • Hand out one piece to the 11-st citizen, leaving Takhashi with no pieces.

In the end, the 11-st citizen will receive 44 pieces, and the 22-nd citizen will receive 33 pieces.

1 3
33
3

Since there is just one citizen, Takahashi will hand out all pieces to that 11-st citizen.

7 1000000000000
99 8 2 4 43 5 3
142857142857
142857142857
142857142858
142857142857
142857142857
142857142857
142857142857