[BOJ 10634] Integer in Integer

View as PDF

Submit solution

Points: 4
Time limit: 10.0s
Memory limit: 128M

Problem types
Allowed languages
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text

Given an integer interval [A,B] and an integer C, your job is to calculate the number of occurrences of C as string in the interval.</p>

For example, 33 appears in 333 twice, and appears in 334 once. Thus the number of occurrences of 33 in [333,334] is 3.

입력 형식

The test case is given by a line with the three integers, A, B, C (0 ≤ A ≤ B ≤ 1010000, 0 ≤ C ≤ 10500).</p>

 

출력 형식

Print the number of occurrences of C mod 1000000007.</p>

 

예제 입력 1

1 3 2

예제 출력 1

1

예제 입력 2

333 334 33

예제 출력 2

3

예제 입력 3

0 10 0

예제 출력 3

2

Comments

There are no comments at the moment.