#P7060. Alice's Digital Alarm Clock Dream
Alice's Digital Alarm Clock Dream
Alice's Digital Alarm Clock Dream
Alice adores her digital alarm clock. Every evening she sets it up before going to sleep. One night, after a dream about her clock, she could only remember the total number of highlighted segments on its display. The clock shows time in a 24-hour format with four digits (with a leading zero if necessary), where the first two digits represent the hour (00 to 23) and the last two represent the minutes (00 to 59).
The clock uses a seven‐segment display for each digit with the following segment counts for each digit in \( \LaTeX \) format:
- \(0\): 6
- \(1\): 2
- \(2\): 5
- \(3\): 5
- \(4\): 4
- \(5\): 5
- \(6\): 6
- \(7\): 3
- \(8\): 7
- \(9\): 6
Given the total number of highlighted segments \( n \) that Alice remembers, determine how many valid times (from 00:00 to 23:59) produce exactly that total number of lit segments. For example, the time 11:11
has segments \(1\)+\(1\)+\(1\)+\(1\) corresponding to \(2+2+2+2=8\) highlighted segments and is the only time with 8 segments.
Note: All times must be considered in the 24-hour format with a leading zero when necessary (e.g., 09:30
).
inputFormat
The input consists of a single integer \( n \) (\(8 \le n \le 26\)) representing the total number of highlighted segments.
outputFormat
Output a single integer: the number of valid times (from 00:00 to 23:59) on the clock that have exactly \( n \) lit segments.
sample
8
1