Seven-Segment Display
Practice
4.1 (342 votes)
Ad Hoc
Basic programming
Easy
Input/output
Problem
49% Success 94501 Attempts 20 Points 1s Time Limit 256MB Memory 1024 KB Max Code
You all must have seen a seven segment display.If not here it is:
Alice got a number written in seven segment format where each segment was creatted used a matchstick.
Example: If Alice gets a number 123 so basically Alice used 12 matchsticks for this number.
Alice is wondering what is the numerically largest value that she can generate by using at most the matchsticks that she currently possess.Help Alice out by telling her that number.
Input Format:
First line contains T (test cases).
Next T lines contain a Number N.
Output Format:
Print the largest possible number numerically that can be generated using at max that many number of matchsticks which was used to generate N.
Constraints:
\(1 \le T \le 100\)
\(1 \le length(N) \le 100\)
Submissions
Please login to view your submissions
Similar Problems
Points:20
536 votes
Tags:
Basic ProgrammingInput/Output
Points:20
16 votes
Tags:
ApprovedBasic ProgrammingEasyImplementationOpen
Points:50
2 votes
Tags:
AlgorithmsApprovedGraphsHardOpen
Editorial