#include <bits/stdc++.h>   const int inf = int(1e9);   const int mod = inf + 7;   const double PI = acos(-1.0);   using namespace std;   const int N = 1e5 + 155;   void solve() {     int n, k, s = 0;     cin >> n >> k;     for (int i = 0; i < n; ++i) {       int x;       cin >> x;       s += x;     }     for (int ans = 0;; ans++) {       int a = 2 * (s + ans * k);       int b = (2 * k - 1) * (ans + n);       if (a >= b) {         cout << ans;         return;       }     }   }   int main() {     ios_base::sync_with_stdio(0);     cin.tie(0);     cout.tie(0);     int t = 1;     while (t--) solve();     return 0;   }   