{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eYou\u0027re given a permutation $a$ of length $n$ ($1 \\le n \\le 10^5$).\u003c/p\u003e\n\u003cp\u003eFor each $i \\in [1,n]$, construct a sequence $s_i$ by the following rules:\u003c/p\u003e\n\u003col\u003e\n \u003cli\u003e$s_i[1]\u003di$;\u003c/li\u003e\n \u003cli\u003eThe length of $s_i$ is $n$, and for each $j \\in [2, n]$, $s_i[j] \\le s_i[j-1]$;\u003c/li\u003e\n \u003cli\u003eFirst, we must choose all the possible elements of $s_i$ from permutation $a$. If the index of $s_i[j]$ in permutation $a$ is $pos[j]$, for each $j \\ge 2$, $|pos[j]-pos[j-1]|\\le k$ ($1 \\le k \\le 10^5$). And for each $s_i$, every element of $s_i$ must occur in $a$ \u003cstrong\u003eat most once\u003c/strong\u003e.\u003c/li\u003e\n \u003cli\u003eAfter we choose all possible elements for $s_i$, if the length of $s_i$ is smaller than $n$, the value of \u003cstrong\u003eevery undetermined element\u003c/strong\u003e of $s_i$ is $0$;\u003c/li\u003e\n \u003cli\u003eFor each $s_i$, we must make its weight high enough.\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003eConsider two sequences $C \u003d [c_1, c_2, ... c_n]$ and $D\u003d[d_1, d_2, ..., d_n]$, we say the weight of $C$ is \u003cstrong\u003ehigher than\u003c/strong\u003e that of $D$ if and only if there exists an integer $k$ such that $1 \\le k \\le n$, $c_i\u003dd_i$ for all $1 \\le i \u0026lt; k$, and $c_k \u0026gt; d_k$.\u003c/p\u003e\n\u003cp\u003eIf for each $i \\in [1,n]$, $c_i\u003dd_i$, the weight of $C$ is equal to the weight of $D$.\u003c/p\u003e\n\u003cp\u003eFor each $i \\in [1,n]$, print the number of non-zero elements of $s_i$ separated by a space.\u003c/p\u003e\n\u003cp\u003eIt\u0027s guaranteed that there is only one possible answer.\u003c/p\u003e\n\u003ch3\u003eInput\u003c/h3\u003e\n\u003cp\u003eThere are multiple test cases.\u003c/p\u003e\n\u003cp\u003eThe first line contains one integer $T(1 \\le T \\le 20)$, denoting the number of test cases.\u003c/p\u003e\n\u003cp\u003eEach test case contains two lines, the first line contains two integers $n$ and $k$ ($1 \\le n,k \\le 10^5$), the second line contains $n$ distinct integers $a_1, a_2, ..., a_n$ ($1 \\le a_i \\le n$) separated by a space, which is the permutation $a$.\u003c/p\u003e\n\u003ch3\u003eOutput\u003c/h3\u003e\n\u003cp\u003eFor each test case, print one line consists of $n$ integers $|s_1|, |s_2|, ..., |s_n|$ separated by a space.\u003c/p\u003e\n\u003cp\u003e$|s_i|$ is the number of non-zero elements of sequence $s_i$.\u003c/p\u003e\n\u003cp\u003eThere is no space at the end of the line.\u003c/p\u003e"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n3 1\n3 2 1\n7 2\n3 1 4 6 2 5 7\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1 2 3\n1 1 2 3 2 3 3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}}]}