luogu#P5134. 好编号
好编号
Problem Description
Given parameters and . A number is called a good number if and only if for every , the following holds: $\dfrac{A}{K^i} - \left\lfloor \dfrac{A}{K^i} \right\rfloor > \dfrac{A}{K^N}$.
Find the number of good numbers modulo .
Input Format
One line with two positive integers .
Output Format
One line, the number of good numbers modulo .
10 10
999989991
6 2
9
Hint
- For of the testdata, .
- For of the testdata, .
- For of the testdata, .
Translated by ChatGPT 5