#include namespace { #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" #include #pragma GCC diagnostic pop using namespace std; using namespace atcoder; #define rep(i,n)for (int i = 0; i < int(n); ++i) #define rrep(i,n)for (int i = int(n)-1; i >= 0; --i) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() template void chmax(T& a, const T& b) { a = max(a, b); } template void chmin(T& a, const T& b) { a = min(a, b); } using ll = long long; using P = pair; using VI = vector; using VVI = vector; using VL = vector; using VVL = vector; int w[20]; ll dist[1000000]; } int main() { ios::sync_with_stdio(false); cin.tie(0); int n; ll l; cin >> n >> l; rep(i, n) cin >> w[i]; sort(w, w + n); int m = w[n - 1]; n--; constexpr ll INF = 1002003004005006007; rep(i, m) dist[i] = INF; auto cmp = [&](const pair& lhs, const pair& rhs) { return lhs.second > rhs.second; }; priority_queue< pair, vector>, decltype(cmp) > q(cmp); auto push = [&](int v, ll d) { if (d < dist[v]) { dist[v] = d; q.emplace(v, d); } }; push(0, 0); while(!q.empty()) { auto [u, d] = q.top(); q.pop(); if (dist[u] != d) continue; rep(i, n) { int v = u + w[i]; ll nd = d + w[i]; if (v >= m) v -= m; push(v, nd); } } ll ans = 0; rep(i, m) { if (dist[i] > l) continue; // dist[i] + (cnt-1)m <= l // cnt <= (l - dist[i]) / m + 1 ans += (l - dist[i]) / m + 1; } ans--; // k = 0 cout << ans << '\n'; }