#P9091. 「SvR-2」Let's Meet at a Higher Place

    ID: 8941 远端评测题 3000ms 512MiB 尝试: 0 已通过: 0 显示难度NOI/NOI+/CTS 上传者: 标签>递推2023数论洛谷原创O2优化素数判断,质数,筛法排列组合容斥原理洛谷月赛根号分治

「SvR-2」Let's Meet at a Higher Place

Background

「Someday,letusmeetatahigherplace!」「Someday, let us meet at a higher place!」

Problem Description

Construct an integer sequence aa of length mm such that for all 1≤i≤m1 \leq i \leq m, ai∈[1,n]a_i \in [1, n].

Take its prefix gcd⁡\gcd, and record it as an integer sequence bb.

The value f(n,m,k)f(n, m, k) is the number of distinct sequences bb that can be constructed in the above way, such that in bb, the number of times adjacent terms are equal is ≤k\leq k.

Given positive integers n,mn, m, Little L asks you to compute the value of $\displaystyle\sum_{i = 1}^n \sum_{j = 1}^m \sum_{k = 0}^{j - 1} f(\lfloor \frac{n}{i} \rfloor, j, k)$.

Since the result may be very large, you only need to output the value modulo 2322^{32}.

Input Format

One line with two integers n,mn, m.

Output Format

One line with one integer, representing the required value.

4 2
26

Hint

Subtask\bf{Subtask} nn mm Score
11 1≤n≤1041 \leq n \leq 10^4 No special restrictions 10pts⁡10 \operatorname{pts}
22 1≤n≤1061 \leq n \leq 10^6 Same as above 20pts⁡20 \operatorname{pts}
33 1≤n≤1091 \leq n \leq 10^9
44 No special restrictions 1≤m≤251 \leq m \leq 25
55 Same as above No special restrictions 30pts⁡30 \operatorname{pts}

For 100%100\% of the testdata, 1≤n≤10101 \leq n \leq 10^{10} and 1≤m≤341 \leq m \leq 34.

Translated by ChatGPT 5