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.

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter23: Simulation With The Excel Add-in @risk
Section: Chapter Questions
Problem 8RP
icon
Related questions
Question

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.

 

 

 

 

 

Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Maximum Flow
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning