#include using namespace std; const int M = 900001; // 最大合計 F*n <= 60*15000 = 900000 int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n, F; cin >> n >> F; vector a(n), b(n), c(n); for (int i=0; i> a[i]; for (int i=0; i> b[i]; for (int i=0; i> c[i]; bitset dp; dp.reset(); dp[0] = 1; for (int i=0; i ndp = (dp << a[i]) | (dp << b[i]) | (dp << c[i]); dp = ndp; cout << dp.count() << endl; } return 0; }