N,Q = map(int,input().split()) dp = [0]*(N+1); sum = [0]*(N+1) dp[1] = 1; for i in range(1,N+1): sum[i] = dp[i]+sum[i-1] for j in range(2,N+1): if i*j > N: break dp[i*j] += dp[i] for i in range(Q): x = int(input()) print(dp[x]*sum[N//x])