import std; void main(){ auto input = readln.chomp.split(" "); auto N = input[0].to!long; auto Q = input[1].to!int; auto count = new long[N + 1]; count[1] = 1; for(auto n = 1; n <= N; n++){ for(auto m = n * 2; m <= N; m += n){ count[m] += count[n]; } } //stderr.writeln(count); auto reverse = new long[N + 1]; for(auto n = N; n > 0; n--){ reverse[n] = 1; for(auto m = n * 2; m <= N; m += n){ reverse[n] += reverse[m]; } } //stderr.writeln(reverse); for(auto q = 0; q < Q; q++){ auto x = readln.chomp.to!long; writeln(count[x] * reverse[x]); } }