should stop precisely one of these boards, at any subsequent you wish. Then, at that point, the boards adjoining it get stopped one second after the fact, the boards nearby those get stopped 2 seconds after the fact, etc. At the end of the day, in the event that you stop board x, board y (for all substantial y) would be stopped precisely |x−y| seconds after the fact.
Correct answer will be upvoted else Multiple Downvoted. Computer science.
You should stop precisely one of these boards, at any subsequent you wish. Then, at that point, the boards adjoining it get stopped one second after the fact, the boards nearby those get stopped 2 seconds after the fact, etc. At the end of the day, in the event that you stop board x, board y (for all substantial y) would be stopped precisely |x−y| seconds after the fact.
For instance, assume there are 4 boards, and the 3-rd board is stopped when the digit 9 is on it.
The board 1 stops 2 seconds after the fact, so it has the digit 1;
the board 2 stops 1 second after the fact, so it has the digit 0;
the board 4 stops 1 second after the fact, so it has the digit 0.
The subsequent 4-digit number is 1090. Note that this model isn't ideal for n=4.
When all boards have been stopped, you compose the digits showed on them from left to right, to frame a n digit number (it can comprise of driving zeros). What is the biggest conceivable number you can get? At first, all boards show 0.
Input
The main line of the input contains a solitary integer t (1≤t≤100) — the number of experiments. Each experiment comprises of a solitary line containing a solitary integer n (1≤n≤2⋅105).
It is ensured that the amount of n over all experiments doesn't surpass 2⋅105.
Output
For each experiment, print the biggest number you can accomplish, in the event that you stop one board ideally.
![](/static/compass_v2/shared-icons/check-mark.png)
Step by step
Solved in 4 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Operations Research : Applications and Algorithms](https://www.bartleby.com/isbn_cover_images/9780534380588/9780534380588_smallCoverImage.gif)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![Operations Research : Applications and Algorithms](https://www.bartleby.com/isbn_cover_images/9780534380588/9780534380588_smallCoverImage.gif)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)