#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, sum = 0;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    sum += x;
  }
  long long l = -1, r = INT_MAX;
  while (r - l > 1) {
    long long mid = (r + l) / 2;
    double x = (double)((mid * k) + sum) / (mid + n);
    if (x >= (double)k - 0.5)
      r = mid;
    else
      l = mid;
  }
  cout << r << endl;
  return false;
}
