Given a one/two digit timing, calculate the possibilities of occurrence of other timings(including the glowing one) with relevant to glowing segments, assuming some segments may not be glowing.
Displaying the numbers is done using seven segment display. It is guaranteed that the sticks currently displaying are working fine.
The first line of the input contains T denoting the number of test cases. For each test case, there is a number x denoting the time.
For each test case, the output is an integer displaying the number of possible timings according to the condition.
Note: The number x should contain 2 digits like 1 should be written as 01.
1. 7 can be replaced by 5 different numbers 9, 3, 8, 0 and 7(if none of the segment is broken) and 8 can be replaced by only 1 number i.e 8 itself(if none of the segment is broken), therefore the answer is 5*1=5.
2. 0 can be replaced by 2 numbers, 8 and 0, while 5 can be replaced by 4 different numbers. So, the answer is 4*2=8.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.