#include using i64 = long long; constexpr int NMAX = 20; constexpr int WMAX = 1000000; constexpr i64 INF = 1LL << 60; i64 dp[WMAX]; int Ws[NMAX]; int ws[NMAX]; int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); int N; i64 L; std::cin >> N >> L; for (int i = 0; i < N; i++) { std::cin >> Ws[i]; } std::sort(Ws, Ws + N); const int W = Ws[0]; for (int i = 1; i < N; i++) { ws[i] = Ws[i] % W; } std::fill(dp, dp + W, INF); dp[0] = 0; using P = std::pair; std::priority_queue, std::greater

> Q; Q.push({0, 0}); while (not Q.empty()) { const auto [c, w] = Q.top(); Q.pop(); if (dp[w] < c) { continue; } for (int i = 1; i < N; i++) { int nw = (w + ws[i]); if (nw >= W) { nw -= W; } const i64 ndp = c + Ws[i]; if (dp[nw] > ndp) { dp[nw] = ndp; Q.push({ndp, nw}); } } } i64 ans = 0; for (int w = 0; w < W; w++) { if (dp[w] > L) { continue; } ans += (L - dp[w]) / W + 1; } std::cout << ans - 1 << "\n"; return 0; }