# ABC162Eの考え方を使えるか # Aの要素をCounter # k=Mから降順で求める # k=mとなるのはすべてがmの倍数の個数をべき乗数とた2のべき乗、引く、mの倍数のときのパターン巣 N, M = map(int, input().split()) A = list(map(int, input().split())) from collections import Counter counted = Counter(A) maxA = max(A) patterns = [0]*(M+1) mod = 998244353 for k in range(M, 0, -1): multiple_count = 0 deduct = 0 for j in range(k, maxA+1, k): multiple_count += counted[j] deduct += patterns[j] calc = 0 if multiple_count > 0: calc += pow(2, multiple_count, mod)-1 calc -= deduct #print('k', k, 'multiple_count', multiple_count, 'deduct', deduct, 'calc', calc) patterns[k] = calc%mod #print(patterns) for p in patterns[1:]: print(p)