#P2188. 小Z的 k 紧凑数
小Z的 k 紧凑数
Description
Xiao Z listed many numbers on scratch paper. He calls an integer a -compact number if the absolute difference between every pair of adjacent digits does not exceed .
Now Xiao Z wants to know how many -compact numbers are within and asks for your help.
Input Format
A single line with three integers .
Output Format
A single line containing one integer: the number of -compact numbers in .
1 13 1
12
Hint
Sample explanation: within , only is not a -compact number.
For of the testdata, .
For another of the testdata, , and is a multiple of .
For of the testdata, , .
Translated by ChatGPT 5
京公网安备 11011102002149号