Preparando MOJI

New Year and Original Order

2000ms 262144K

Description:

Let S(n) denote the number that represents the digits of n in sorted order. For example, S(1) = 1, S(5) = 5, S(50394) = 3459, S(353535) = 333555.

Given a number X, compute modulo 109 + 7.

Input:

The first line of input will contain the integer X (1 ≤ X ≤ 10700).

Output:

Print a single integer, the answer to the question.

Sample Input:

21

Sample Output:

195

Sample Input:

345342

Sample Output:

390548434

Note:

The first few values of S are 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 12. The sum of these values is 195.

Informação

Codeforces

Provedor Codeforces

Código CF908G

Tags

dpmath

Submetido 0

BOUA! 0

Taxa de BOUA's 0%

Datas 09/05/2023 09:21:53

Relacionados

Nada ainda