#include constexpr int NMAX = 20; constexpr int WMAX = 1000000; struct Deq { Deq() {} int front() const { return BUF[head]; } bool isEmpty() const { return (head == tail); } void pushFront(int v) { --head; if (head < 0) { head += (WMAX + 1); } BUF[head] = v; } void pushBack(int v) { BUF[tail++] = v; if (tail == WMAX + 1) { tail -= (WMAX + 1); } } void popFront() { head++; if (head == WMAX + 1) { head -= (WMAX + 1); } } int BUF[WMAX + 1]; int head = 0, tail = 0; }; constexpr int INF = 1 << 30; int dp[WMAX]; int Ws[NMAX]; int main() { using i64 = long long; 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, std::greater{}); const int W = Ws[0]; std::fill(dp, dp + WMAX, INF); dp[0] = 0; Deq Q; Q.pushFront(0); while (not Q.isEmpty()) { const int w = Q.front(); Q.popFront(); for (int i = 1; i < N; i++) { int nw = w + Ws[i]; if (nw >= W) { nw -= W; if (dp[nw] > dp[w] + 1) { dp[nw] = dp[w] + 1; Q.pushBack(nw); } } else { if (dp[nw] > dp[w]) { dp[nw] = dp[w]; Q.pushFront(nw); } } } } i64 ans = 0; for (int w = 0; w < W; w++) { if (w > L) { break; } const i64 l = (L - w) / W; if (l < dp[w]) { continue; } ans += l - dp[w] + 1; } std::cout << ans - 1 << "\n"; return 0; }