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.**

**Input: **

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.

**Output:**

For each test case, the output is an integer displaying the number of possible timings according to the condition.

**Constraints:**

1<=T<=100

0<=x<=99

**Note: ** The number **x** should contain 2 digits like 1 should be written as 01.

**Example:
Input**

2

78

05

5

8

**Explanation:
1. 7** can be replaced by

Author: Vanshika_pec

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.

VISHESHA SADU | 27 |

ghanshyam648 | 25 |

Biswajit3 | 21 |

karthik_kasaragadda | 20 |

tanya_sharma | 18 |

KshatriyaYash | 1066 |

nikhil_sojan | 978 |

lonecoder | 935 |

mazumderrohit8 | 864 |

SumitSingh27 | 832 |

blackshadows | 5327 |

Ibrahim Nash | 5215 |

akhayrutdinov | 5111 |

mb1973 | 4468 |

Quandray | 4444 |

Login to report an issue on this page.