#include using namespace std; using ll = long long; template istream& operator >> (istream& is, vector& vec) { for(T& x : vec) is >> x; return is; } template ostream& operator << (ostream& os, const vector& vec) { if(vec.empty()) return os; os << vec[0]; for(auto it = vec.begin(); ++it != vec.end(); ) os << ' ' << *it; return os; } int main(){ ios::sync_with_stdio(false); cin.tie(0); int n, f; cin >> n >> f; vector a(n), b(n), c(n); cin >> a >> b >> c; bitset<900001> B; B[0] = 1; array ary; for(int i = 0; i < n; i++){ ary = {a[i], b[i], c[i]}; sort(ary.begin(), ary.end()); int c1 = ary[1] - ary[0]; int c2 = ary[2] - ary[0]; B |= (B << c1) | (B << c2); cout << B.count() << '\n'; } }