408493: GYM103150 G Segmentation Fault
Description
You have an infinitely long digital panel. Each digit consists of $$$7$$$ segments, which can be turned on or off to display different numbers. The picture shows how all $$$10$$$ decimal digits are displayed.
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases.
The only line of each test case contains a single integer $$$n$$$ ($$$2 \leq n \leq 2 \cdot 10^5$$$).
The sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
OutputFor each test case, output two space-separated positive integers — the minimum and maximum possible values of the number on the panel, respectively.
ExampleInput3 2 3 4Output
1 1 7 7 4 11Note
By turning on two segments, the only number you can display is $$$1$$$.
By turning on three segments, the only number you can display is $$$7$$$.
By turning on four segments, the smallest number you can display is $$$4$$$ and the largest number you can display is $$$11$$$.