#include using u64 = unsigned long long; constexpr uint NMAX = 20; constexpr uint WMAX = 1000000; constexpr u64 INF = 1ULL << 60; u64 dp[WMAX]; uint Ws[NMAX]; uint ws[NMAX]; int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); uint N; u64 L; std::cin >> N >> L; for (uint i = 0; i < N; i++) { std::cin >> Ws[i]; } std::sort(Ws, Ws + N); const uint W = Ws[0]; for (uint 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 (uint i = 1; i < N; i++) { uint nw = (w + ws[i]); if (nw >= W) { nw -= W; } const u64 ndp = c + Ws[i]; if (dp[nw] > ndp) { Q.push({ndp, nw}); dp[nw] = ndp; } } } u64 ans = 0; for (uint w = 0; w < W; w++) { if (dp[w] > L) { break; } ans += (L - dp[w]) / W + 1; } std::cout << ans - 1 << "\n"; return 0; }