#Q167. 「一本通 5.3 例 3」Windy 数
「一本通 5.3 例 3」Windy 数
Description
Original source: SCOI 2009
Windy has defined a type of number called a Windy number: a positive integer without leading zeros and where the absolute difference between every pair of adjacent digits is at least .
Windy wants to know how many Windy numbers exist between and , inclusive.
Input Format
One line containing two numbers, and .
Output Format
Output a single integer representing the answer.
Sample 1
1 10
9
Sample 2
25 50
20
Data Range and Hints
of the data satisfies ;
of the data satisfies .