306422: CF1194G. Another Meme Problem

Memory Limit:512 MB Time Limit:4 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Another Meme Problem

题意翻译

CF1194G 另一个MEME问题 **题目描述** 称一个分数$\frac xy$“优秀”指存在至少一个分数$\frac{x'}{y'}=\frac x y$, $1\le x',y'\le9$且$x$和$y$的十进制表示法中分别包含$x'$和$y'$。例如,$\frac{26}{13}$是“优秀”的,因为$\frac{26}{13}=\frac21$。 你的任务是计算当$1\le x,y\le n$时有多少“优秀”的分数$\frac xy$。由于答案可能很大,因此你只需输出答案对$998244353$取模后的值。 **输入格式** 一行整数$n$。 **输出格式** 一行整数,当$1\le x,y\le n$时“优秀”的分数$\frac xy$的个数对$998244353$取模后的值。 **提示** $1\le n<10^{100}$(记得用高精度)

题目描述

Let's call a fraction $ \frac{x}{y} $ good if there exists at least one another fraction $ \frac{x'}{y'} $ such that $ \frac{x}{y} = \frac{x'}{y'} $ , $ 1 \le x', y' \le 9 $ , the digit denoting $ x' $ is contained in the decimal representation of $ x $ , and the digit denoting $ y' $ is contained in the decimal representation of $ y $ . For example, $ \frac{26}{13} $ is a good fraction, because $ \frac{26}{13} = \frac{2}{1} $ . You are given an integer number $ n $ . Please calculate the number of good fractions $ \frac{x}{y} $ such that $ 1 \le x \le n $ and $ 1 \le y \le n $ . The answer may be really large, so print it modulo $ 998244353 $ .

输入输出格式

输入格式


The only line of the input contains one integer $ n $ ( $ 1 \le n < 10^{100} $ ).

输出格式


Print the number of good fractions $ \frac{x}{y} $ such that $ 1 \le x \le n $ and $ 1 \le y \le n $ . The answer may be really large, so print it modulo $ 998244353 $ .

输入输出样例

输入样例 #1

42

输出样例 #1

150

输入样例 #2

3141592653589793238462643383279

输出样例 #2

459925407

Input

题意翻译

CF1194G 另一个MEME问题 **题目描述** 称一个分数$\frac xy$“优秀”指存在至少一个分数$\frac{x'}{y'}=\frac x y$, $1\le x',y'\le9$且$x$和$y$的十进制表示法中分别包含$x'$和$y'$。例如,$\frac{26}{13}$是“优秀”的,因为$\frac{26}{13}=\frac21$。 你的任务是计算当$1\le x,y\le n$时有多少“优秀”的分数$\frac xy$。由于答案可能很大,因此你只需输出答案对$998244353$取模后的值。 **输入格式** 一行整数$n$。 **输出格式** 一行整数,当$1\le x,y\le n$时“优秀”的分数$\frac xy$的个数对$998244353$取模后的值。 **提示** $1\le n<10^{100}$(记得用高精度)

加入题单

算法标签: