CF1194G.Another Meme Problem

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Let's call a fraction xy\frac{x}{y} good if there exists at least one another fraction xy\frac{x'}{y'} such that xy=xy\frac{x}{y} = \frac{x'}{y'} , 1x,y91 \le x', y' \le 9 , the digit denoting xx' is contained in the decimal representation of xx , and the digit denoting yy' is contained in the decimal representation of yy . For example, 2613\frac{26}{13} is a good fraction, because 2613=21\frac{26}{13} = \frac{2}{1} .

You are given an integer number nn . Please calculate the number of good fractions xy\frac{x}{y} such that 1xn1 \le x \le n and 1yn1 \le y \le n . The answer may be really large, so print it modulo 998244353998244353 .

输入格式

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

输出格式

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

输入输出样例

  • 输入#1

    42
    

    输出#1

    150
    
  • 输入#2

    3141592653589793238462643383279
    

    输出#2

    459925407
    
首页