Maniacal Midsummer Marathon 2014 by AL, TL, JJ
Shiro is enthralled by the latest FPS (first person shooter) game in the Eastern Federation. A lot is riding on this game, so she is planning to snipe the other player, Izuna, for a decisive victory. Shiro plans to pull this off from a kilometer away, and Izuna is in a shelter, so this requires very advanced mathematical calculations. Shiro needs a special sequence of numbers, the Kuuhaku numbers (a.k.a. KH-numbers) to accomplish her goal.
The KH-numbers have an interesting property: examining each digit of an
Shiro needs all the KH-numbers between
Input Specification
The
The
You can assume for test cases worth
Output Specification
A single integer, the number of KH-numbers between
Sample Input 1
111111
111131
Sample Output 1
17
Explanation for Sample 1
The valid KH-numbers are
Sample Input 2
2454449
2454455
Sample Output 2
2
Explanation for Sample 2
The valid KH-numbers are
Sample Input 3
1111111
1111123
Sample Output 3
13
Explanation for Sample 3
All numbers between
Comments