import java.util.Scanner; import java.io.PrintWriter; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int N = sc.nextInt(); int Q = sc.nextInt(); long[] dp = new long[N+1]; long[] sum = new long[N+1]; dp[1] = 1; for( int i = 1; i <= N; i++ ) { sum[i] = dp[i]+sum[i-1]; for( int j = 2; i*j <= N; j++ ) { dp[i*j] += dp[i]; } } for( int i = 0; i < Q; i++ ) { int x = Integer.parseInt(sc.next()); pw.println(dp[x]*sum[N/x]); } sc.close(); pw.flush(); } }