A - ヘビがヘビー Editorial /

Time Limit: 2 sec / Memory Limit: 1024 MB

配点: 100

問題文

ヘビーなヘビが N 匹います。
これらのヘビのヘビー度の平均値は W です。

ヘビー度が平均値より真に大きいヘビは最大で何匹いるでしょうか?
ただし、各ヘビのヘビー度は実数値であるものとします。

制約

  • 入力は全て整数である。
  • 1 \leq N \leq 100
  • 1 \leq W \leq 100

入力

入力は以下の形式で標準入力から与えられます。

N W

出力

ヘビー度が平均値より真に大きいヘビの数として考えられる最大値を、1 行に出力してください。


入力例1

1 3

出力例1

0

1 匹のヘビのヘビー度は 3 です。平均値 3 よりもヘビー度が大きいヘビは存在しません。


入力例2

3 2

出力例2

2

例えば、各ヘビのヘビー度が {1, \frac{5}{2}, \frac{5}{2}} であるとき 2 匹のヘビのヘビー度が平均値 2 よりも大きく、これが最大となります。
3 匹以上のヘビのヘビー度が平均値よりも真に大きくなるようなヘビのヘビー度の組み合わせは存在しません。

writer: TMJN

Score: 100 points

問題文

There are N heavy snakes.
The average of heavy-degrees of these snakes is W.

How many snakes which has more heavy-degree than the average are there at most?
It is guaranteed that heavy-degree of each snakes are rational numbers.

Constraints

  • Input are all integers.
  • 1 \leq N \leq 100
  • 1 \leq W \leq 100

Input

Input is given from Standard Input in the following format.

N W

Output

Print the maximum number of snakes which has more heavy-degree than the average.


Sample Input 1

1 3

Sample Output 1

0

the heavy-degree of one snake is 3. There's no snake which has more heavy-degree than the average 3.


Sample Input2

3 2

Sample Output2

2

When the heavy-degrees of each snakes are {1, \frac{5}{2}, \frac{5}{2}} , the heavy-degree of two snakes are more than the average 2 and this is the maximum number.
There is no way to heavy-degrees of more than three snakes are more than the average.

writer: TMJN