#include <bits/stdc++.h>
using namespace std;
int rVAL(int a, int b) {
  double c, d, avg;
  c = (double)a / (double)b - a / b;
  if (c < 0.5)
    return a / b;
  else
    return a / b + 1;
}
int main() {
  int n, k, i, sum = 0, avg = 0;
  scanf("%d %d", &n, &k);
  double x = 0, t = k - 0.5;
  int a[n];
  for (i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  avg = rVAL(sum, n);
  x = (t * (double)n - (double)sum) * 2;
  if (x > 0)
    printf("%0.0lf\n", x);
  else
    cout << "0" << endl;
}
