n, q=gets.to_s.split.map{ |e| e.to_i } v=Array.new(n+1, 0) v[1]=1 for i in 1..n+1 c=i*2 while c<=n v[c]+=v[i] c+=i end end q.times do t=gets.to_s.to_i f=0 for j in 0..n/t f+=v[j] end puts v[t]*f end