atcoder#ARC090D. [ARC090F] Number of Digits
[ARC090F] Number of Digits
Score : points
Problem Statement
For a positive integer , let us define as the number of digits in base .
You are given an integer . Count the number of the pairs of positive integers () such that , and find the count modulo .
Constraints
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
1
9
There are nine pairs that satisfies the condition: , , , .
2
98
There are pairs that satisfies the condition, such as and .
123
460191684
36018
966522825
1000
184984484