#pragma GCC optimize("O3") #include "bits/stdc++.h" using namespace std; int main() { cin.tie(nullptr); ios::sync_with_stdio(false); int n, f; cin >> n >> f; vector<int> a(n), b(n), c(n); for (auto&& i : a) cin >> i; for (auto&& i : b) cin >> i; for (auto&& i : c) cin >> i; bitset<15000 * 60 + 1> bs(0); bs[0] = 1; for (int i = 0; i < n; ++i) { bitset<15000 * 60 + 1> bs2(0); bs2 |= bs << a[i]; bs2 |= bs << b[i]; bs2 |= bs << c[i]; bs = move(bs2); cout << bs.count() << "\n"; } }