#include #if __has_include() #include using namespace atcoder; #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using namespace std; using mint = modint998244353; int main() { int n, m; cin >> n >> m; vector a(n); rep(i, n) cin >> a[i]; vector cnt(m+1); for (int x : a) { cnt[x]++; } vector pow2(n+1, 1); rep(i, n) pow2[i+1] = pow2[i]*2; vector b(m+1); for (int i = 1; i <= m; ++i) { for (int j = i; j <= m; j += i) { b[i] += cnt[j]; } } vector ans(m+1); for (int i = m; i >= 1; --i) { ans[i] = pow2[b[i]]-1; for (int j = i*2; j <= m; j += i) { ans[i] -= ans[j]; } } for (int i = 1; i <= m; ++i) cout << ans[i].val() << '\n'; return 0; }