P27447 [AtCoder] Heavy Snakes
普及
题目描述

Problem Description

There are $ N $ heavy snakes.
The average heaviness of these snakes is $ W $.

What is the maximum number of snakes whose heaviness is strictly greater than the average?
Assume that the heaviness of each snake is a real number.

Input Format

The input is given from the standard input in the following format.

$ N $ $ W $

Output Format

Output the maximum number of snakes whose heaviness is strictly greater than the average, on a single line.

Sample Input and Output

Sample Input #1

1 3

Sample Output #1

0

Sample Input #2

3 2

Sample Output #2

2

Notes/Hints

Constraints

  • All inputs are integers.
  • $1 \leq N \leq 100$
  • $1 \leq W \leq 100$

Sample Explanation 1

The heaviness of the single snake is $ 3 $. There are no snakes whose heaviness is greater than the average $ 3 $.

Sample Explanation 2

For example, when the heaviness of each snake is {$1, \frac{5}{2}, \frac{5}{2}$}, the heaviness of $ 2 $ snakes is greater than the average $ 2 $, which is the maximum. There is no combination of heaviness values for the snakes where more than $ 3 $ snakes have a heaviness strictly greater than the average.

输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
1 3
样例输出
0