luogu#P4882. lty loves 96!
lty loves 96!
Background
As everyone knows, really likes the two digits (if your mind went the wrong way, go face the wall right now), even more than repeating a grade (a repeating student)!
Problem Description
Because of “loving what someone loves”, also likes numbers that “contain ”. Here, “contain” does not mean the usual kind of contain, but must satisfy all of the following properties (all three must be met):
- The number is an -digit number and has no leading zeros.
- In this number, the digits and appear at least times in total (example: has occurrences in total: appears times and appears times, for a total of ).
- There exist three consecutive digits , , that satisfy at least one of the following:
- equals or .
- % equals or . If is , then this condition is considered not satisfied.
Input Format
One line with two numbers , .
Output Format
One number, representing the count of such numbers.
3 1
16
Hint
For of the testdata, .
For of the testdata, .
For of the testdata, , .
Translated by ChatGPT 5