#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int sum = 0;
  for (int i = 0; i < n; ++i) {
    int a;
    cin >> a;
    sum += a;
  }
  double pp = sum / (n * 1.0);
  if (pp >= (k - 0.5)) {
    cout << 0;
    return 0;
  }
  double z = 0.5;
  double p = (n * (k - 0.5)) - sum;
  double ans = p / z * 1.0;
  cout << ans;
  return 0;
}
