#include <bits/stdc++.h>
using namespace std;
long long n, k, sum, x, mid, st, dr, N, Sum, i;
int main() {
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> x;
    sum += x;
  }
  if (2 * sum >= n * (2 * k - 1)) {
    cout << 0;
    return 0;
  }
  st = 1;
  dr = 1000000000000LL;
  while (st <= dr) {
    int mid = (st + dr) / 2;
    Sum = sum + mid * k;
    N = n + mid;
    if (2 * Sum >= N * (2 * k - 1))
      dr = mid - 1;
    else
      st = mid + 1;
  }
  cout << st;
  return 0;
}
