#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int32_t n, x; cin >> n >> x; vector ss(n); for (auto &&s : ss) { cin >> s; } auto sum = accumulate(ss.begin(), ss.end(), int64_t(0)); cout << sum - int64_t(x) * (n - 1) << endl; return 0; }