Rating changes for the last round are temporarily rolled back. They will be returned soon.
×

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

No tag edit access

В условии задачи недавно были сделаны правки. Просмотреть изменения.

×
C. Polycarpus' Dice

time limit per test

1 secondmemory limit per test

256 megabytesinput

standard inputoutput

standard outputPolycarp has *n* dice *d*_{1}, *d*_{2}, ..., *d*_{n}. The *i*-th dice shows numbers from 1 to *d*_{i}. Polycarp rolled all the dice and the sum of numbers they showed is *A*. Agrippina didn't see which dice showed what number, she knows only the sum *A* and the values *d*_{1}, *d*_{2}, ..., *d*_{n}. However, she finds it enough to make a series of statements of the following type: dice *i* couldn't show number *r*. For example, if Polycarp had two six-faced dice and the total sum is *A* = 11, then Agrippina can state that each of the two dice couldn't show a value less than five (otherwise, the remaining dice must have a value of at least seven, which is impossible).

For each dice find the number of values for which it can be guaranteed that the dice couldn't show these values if the sum of the shown values is *A*.

Input

The first line contains two integers *n*, *A* (1 ≤ *n* ≤ 2·10^{5}, *n* ≤ *A* ≤ *s*) — the number of dice and the sum of shown values where *s* = *d*_{1} + *d*_{2} + ... + *d*_{n}.

The second line contains *n* integers *d*_{1}, *d*_{2}, ..., *d*_{n} (1 ≤ *d*_{i} ≤ 10^{6}), where *d*_{i} is the maximum value that the *i*-th dice can show.

Output

Print *n* integers *b*_{1}, *b*_{2}, ..., *b*_{n}, where *b*_{i} is the number of values for which it is guaranteed that the *i*-th dice couldn't show them.

Examples

Input

2 8

4 4

Output

3 3

Input

1 3

5

Output

4

Input

2 3

2 3

Output

0 1

Note

In the first sample from the statement *A* equal to 8 could be obtained in the only case when both the first and the second dice show 4. Correspondingly, both dice couldn't show values 1, 2 or 3.

In the second sample from the statement *A* equal to 3 could be obtained when the single dice shows 3. Correspondingly, it couldn't show 1, 2, 4 or 5.

In the third sample from the statement *A* equal to 3 could be obtained when one dice shows 1 and the other dice shows 2. That's why the first dice doesn't have any values it couldn't show and the second dice couldn't show 3.

Codeforces (c) Copyright 2010-2020 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/25/2020 10:10:44 (i1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|