Killjee And X-Numbers

0

0 votes
Hard
Problem

Killjee gives you two numbers L and R and a digit X. You need to find how many numbers are there which are greater than equal to L and less than equal to R and have digit X in them.

 

INPUT

Input contains 3 space separated integer L,R,X.

OUTPUT

Print answer to the problem.

CONSTRAINTS

1LR1018

1X9

Sample Input
5 100 1
Sample Output
19
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

10,11,12,13,14,15,16,17,18,19,21,31,41,51,61,71,81,91,100 contains 1 as their digit.

Editor Image

?