Dustin has an array $$$a_1,a_2,\dots,a_n$$$ where each element is initially $$$0$$$ and is unmarked. The distance between the $$$i$$$-th element and the $$$j$$$-th element is $$$|i-j|$$$. He also has $$$q$$$ updates of two types:
The first line contains $$$2$$$ integers, $$$n$$$ and $$$q$$$ ($$$1 \leq n$$$, $$$q \leq 10^5$$$).
Then $$$q$$$ lines follow, which describes the updates. Each line is given by one of the following formats:
Please output Dustin's array, $$$a_1,a_2,\dots,a_n$$$, after all updates are applied.
10 10 1 3 1 6 2 2 1 1 7 2 3 5 1 6 2 1 1 2 2 1 1 3 2 10 1
8 9 9 9 8 9 9 9 7 6
1 1 1 1
0
In the first test case, the array is of size $$$10$$$ and there are $$$10$$$ updates. The array after each update is shown below.
| $$$1 \; 3$$$ | $$$[0, 0, \color{red}{0}, 0, 0, 0, 0, 0, 0, 0]$$$ |
| $$$1 \; 6$$$ | $$$[0, 0, \color{red}{0}, 0, 0, \color{red}{0}, 0, 0, 0, 0]$$$ |
| $$$2 \; 2 \; 1$$$ | $$$[1, 1, \color{red}{1}, 1, 1, \color{red}{1}, 1, 1, 0, 0]$$$ |
| $$$1 \; 7$$$ | $$$[1, 1, \color{red}{1}, 1, 1, \color{red}{1}, \color{red}{1}, 1, 0, 0]$$$ |
| $$$2 \; 3 \; 5$$$ | $$$[6, 6, \color{red}{6}, 6, 6, \color{red}{6}, \color{red}{6}, 6, 5, 5]$$$ |
| $$$1 \; 6$$$ | $$$[6, 6, \color{red}{6}, 6, 6, 6, \color{red}{6}, 6, 5, 5]$$$ |
| $$$2 \; 1 \; 1$$$ | $$$[6, 7, \color{red}{7}, 7, 6, 7, \color{red}{7}, 7, 5, 5]$$$ |
| $$$2 \; 2 \; 1$$$ | $$$[7, 8, \color{red}{8}, 8, 7, 8, \color{red}{8}, 8, 6, 5]$$$ |
| $$$1 \; 3$$$ | $$$[7, 8, 8, 8, 7, 8, \color{red}{8}, 8, 6, 5]$$$ |
| $$$2 \; 10 \; 1$$$ | $$$[8, 9, 9, 9, 8, 9, \color{red}{9}, 9, 7, 6]$$$ |
Problem Credits: Alex Liang