Blackslex has found solace in plants and trees amidst accumulated stress from strained relationships, stressful politics, and strenuous research.
Blackslex has $$$n$$$ plants ordered in a straight line, consisting of plant $$$1, 2, 3, \ldots n$$$. Initially, every plant contains $$$0$$$ millilitres of water.
He wants to perform $$$q$$$ watering operations as follows :
where $$$f(x)$$$ denotes the product of $$$x$$$ and the value of the least significant set bit of $$$x$$$ $$$^{\text{∗}}$$$ Your task is to figure out the amount of water in each plant after all watering operations are done.
$$$^{\text{∗}}$$$The value of the least significant set bit of $$$x$$$ is the value of the rightmost set bit (bit that is 1) in the binary representation of $$$x$$$. For instance, the value of the least significant set bit of $$$10 = 1010_2$$$ is $$$0010_2 = 2$$$
The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^4$$$) — the number of test cases.
The first line of each test case contains two integers $$$n$$$, $$$q$$$ ($$$1 \leq n, q \leq 2\cdot 10^5$$$) — the number of plants and the number of watering operations, respectively.
The next $$$q$$$ lines of each test case contain two integers $$$l$$$, $$$r$$$ ($$$1 \leq l \leq r \leq n$$$) — the left bound and the right bound for each watering operation.
It is guaranteed that the sum of all values of $$$n$$$ and the sum of all values of $$$q$$$ across all test cases do not exceed $$$2 \cdot 10^5$$$.
For each test case, output $$$n$$$ integers representing the amount of water in the $$$i$$$-th plant for each $$$i = 1, 2, 3, \ldots, n$$$
25 31 52 32 57 71 31 63 74 77 71 65 5
1 6 11 19 213 12 10 37 18 43 22
In the first case, each operation will be performed as follows :
Hence, the total amount of water in each plant is :