#include <bits/stdc++.h>
using namespace std;
const long long linf = 1LL << 62;
const int iinf = 1000000009;
const double dinf = 1e15;
const int Mod = 19930726;
const int maxn = 1000005;
const int MAXN = 500005;
struct Pam_Tree {
  int nxt[maxn][26];
  int fail[maxn];
  int cnt[maxn];
  int num[maxn];
  int len[maxn];
  int S[maxn];
  int lst, n, p;
  int newnode(int l) {
    for (int i = 0; i <= 25; i++) nxt[p][i] = 0;
    cnt[p] = 0;
    num[p] = 0;
    len[p] = l;
    return p++;
  }
  void init() {
    p = 0;
    newnode(0);
    newnode(-1);
    lst = 0;
    n = 0;
    S[n] = -1;
    fail[0] = 1;
  }
  int get_fail(int x) {
    while (S[n - len[x] - 1] != S[n]) x = fail[x];
    return x;
  }
  int add(int c) {
    S[++n] = c;
    int cur = get_fail(lst);
    if (!nxt[cur][c]) {
      int now = newnode(len[cur] + 2);
      fail[now] = nxt[get_fail(fail[cur])][c];
      nxt[cur][c] = now;
      num[now] = num[fail[now]] + 1;
    }
    lst = nxt[cur][c];
    cnt[lst]++;
    return len[lst];
  }
  void count() {
    for (int i = p - 1; i >= 0; i--) cnt[fail[i]] += cnt[i];
  }
};
Pam_Tree pt;
int dcmp(double x) {
  if (fabs(x) <= 1e-9) return 0;
  return x < 0 ? -1 : 1;
}
struct Point {
  long long x, y;
  Point(long long x = 0, long long y = 0) : x(x), y(y) {}
  Point operator-(const Point &a) const { return Point(x - a.x, y - a.y); }
  bool operator<(const Point &a) const {
    if (a.x == x) return y > a.y;
    return x < a.x;
  }
};
long long Dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
long long Cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
double len(Point a) { return sqrt(Dot(a, a)); }
struct node {
  long long x, id;
  node(long long x = 0, long long id = 0) : x(x), id(id) {}
  bool operator<(const node &a) const {
    if (x == a.x) return id < a.id;
    return x > a.x;
  }
};
struct Node {
  int l;
  long long x;
  bool operator<(const Node &a) const {
    if (l == a.l) return x < a.x;
    return l > a.l;
  }
};
long long quick_pow(long long a, long long b) {
  long long base = 1;
  while (b) {
    if (b & 1) base = base * a % Mod;
    a = a * a % Mod;
    b >>= 1;
  }
  return base % Mod;
}
int n, k, a, cur;
void solve() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n >> k;
  long long sum = 0;
  cur = 1;
  for (int i = 1; i <= n; i++) cin >> a, sum += a;
  if (int(sum * 1.0 / n + 0.5) >= k) {
    cout << 0 << '\n';
    return;
  }
  while (1) {
    sum++;
    a = cur / k;
    if (cur % k) a++;
    if (int(sum * 1.0 / (n + a) + 0.5) >= k) {
      cout << a << '\n';
      return;
    }
    cur++;
  }
}
int main() {
  int tt = 1;
  while (tt--) solve();
  return 0;
}
