#P8547. 小挖的时间
小挖的时间
Problem Description
Xiao Wa has a digital clock that uses a -hour format and shows only hours and minutes, i.e., it only displays . The time after is .
The hour has no leading zero, but the minutes may have one (for example, will not be written as , while will not be written as ).
Starting from noon of some day (i.e., ), Xiao Wa stares at this digital clock for a total of minutes. They now want to know: how many times in total will they see a time whose digits form an arithmetic progression?
The definition of an arithmetic progression is as follows: if a sequence is an arithmetic progression, then every number after the first equals the previous one plus a fixed common difference. For example, is such a time with common difference , and is such a time with common difference .
If you look carefully, you will notice that the common difference is not restricted in sign, so it can be positive or negative.
Input Format
Line : a positive integer , meaning this test point contains groups of testdata.
Lines : each line contains a non-negative integer , with the meaning described above.
Output Format
Output lines in total. Each line contains an integer , representing the number of arithmetic-progression times seen.
6
34
60
100
118
50
106
1
1
4
5
1
4
Hint
For of the data, .
For of the data, .
For of the data, , .
Sample Explanation
For the first query , the interval is from . Only satisfies the requirement.
For the third query , the interval is from . There are four times that satisfy the requirement: .
For the fourth query , the interval is from . There are five times that satisfy the requirement: .
Translated by ChatGPT 5