import sun.management.counter.LongArrayCounter import scala.annotation.tailrec import scala.io.StdIn.* import scala.math.* @main def main = val Array(n, q) = readLine().split(' ').map(_.toInt) val query = Array.fill(q){readLine().toInt} val count = Array.fill(n + 1){0} count(1) = 1 @tailrec def update(current: Int, value: Int, multiplier: Int): Unit = if value * multiplier <= n then count(value * multiplier) += current update(current, value, multiplier + 1) for i <- 1 to n do update(count(i), i, 2) val result = Array.fill(q){0L} for (x, i) <- query.zipWithIndex do val left = count(x) var right = 0L for j <- 1 to n / x do right += count(j) result(i) = left * right println(result.mkString("\n"))