luogu#P9091. 「SvR-2」Let's Meet at a Higher Place
「SvR-2」Let's Meet at a Higher Place
Background
Problem Description
Construct an integer sequence of length such that for all , .
Take its prefix , and record it as an integer sequence .
The value is the number of distinct sequences that can be constructed in the above way, such that in , the number of times adjacent terms are equal is .
Given positive integers , 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 .
Input Format
One line with two integers .
Output Format
One line with one integer, representing the required value.
4 2
26
Hint
| Score | |||
|---|---|---|---|
| No special restrictions | |||
| Same as above | |||
| No special restrictions | |||
| Same as above | No special restrictions |
For of the testdata, and .
Translated by ChatGPT 5