{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eSichuan hotpot is one of the most famous dishes around the world. People love its spicy taste.\u003c/p\u003e\u003cp\u003eThere are $$$n$$$ tourists, numbered from $$$0$$$ to $$$(n-1)$$$, sitting around a hotpot. There are $$$k$$$ types of ingredients for the hotpot in total and the $$$i$$$-th tourist favors ingredient $$$a_i$$$ most. Initially, every tourist has a happiness value of $$$0$$$ and the pot is empty.\u003c/p\u003e\u003cp\u003eThe tourists will perform $$$m$$$ moves one after another, where the $$$i$$$-th (numbered from $$$0$$$ to $$$(m - 1)$$$) move is performed by tourist $$$(i \\mod n)$$$. When tourist $$$t$$$ moves: \u003c/p\u003e\u003cul\u003e \u003cli\u003e If ingredient $$$a_t$$$ exists in the pot, he will eat them all and gain $$$1$$$ happiness value. \u003c/li\u003e\u003cli\u003e Otherwise, he will put one unit of ingredient $$$a_t$$$ into the pot. His happiness value remains unchanged. \u003c/li\u003e\u003c/ul\u003e\u003cp\u003eYour task is to calculate the happiness value for each tourist after $$$m$$$ moves.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThere are multiple test cases. The first line of the input contains an integer $$$T$$$ ($$$1 \\le T \\le 10^3$$$) indicating the number of test cases. For each test case:\u003c/p\u003e\u003cp\u003eThe first line contains three integers $$$n$$$, $$$k$$$ and $$$m$$$ ($$$1 \\le n \\le 10^5$$$, $$$1 \\le k \\le 10^5$$$, $$$1 \\le m \\le 10^9$$$) indicating the number of tourists, the number of types of ingredients and the number of moves.\u003c/p\u003e\u003cp\u003eThe second line contains $$$n$$$ integers $$$a_0, a_1, \\cdots, a_{n-1}$$$ ($$$1 \\le a_i \\le k$$$) where $$$a_i$$$ indicates the favorite ingredient of tourist $$$i$$$.\u003c/p\u003e\u003cp\u003eIt\u0027s guaranteed that neither the sum of $$$n$$$ nor the sum of $$$k$$$ of all the test cases will exceed $$$2 \\times 10^5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case output $$$n$$$ integers $$$h_0, h_1, \\cdots, h_{n-1}$$$ in one line separated by a space, where $$$h_i$$$ indicates the happiness value of tourist $$$i$$$ after $$$m$$$ moves.\u003c/p\u003e\u003cp\u003ePlease, DO NOT output extra spaces at the end of each line, or your answer might be considered incorrect!\u003c/p\u003e"}},{"title":"Examples","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\u003e4\n3 2 6\n1 1 2\n1 1 5\n1\n2 2 10\n1 2\n2 2 10\n1 1\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0 2 1\n2\n2 2\n0 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eThe first sample test case is explained as follows:\u003c/p\u003e\u003ccenter\u003e \u003ctable class\u003d\"tex-tabular\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003eMove\u003c/span\u003e\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003eTourist\u003c/span\u003e\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003eAction\u003c/span\u003e\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e\u003cspan class\u003d\"tex-font-style-bf\"\u003ePot after move\u003c/span\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e0\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e0\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003ePuts ingredient 1 into the pot\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e$$$\\{1\\}$$$\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e1\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e1\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003eEats ingredient 1 in the pot\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e$$$\\{\\}$$$\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e2\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e2\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003ePuts ingredient 2 into the pot\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e$$$\\{2\\}$$$\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e3\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e0\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003ePuts ingredient 1 into the pot\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e$$$\\{1, 2\\}$$$\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e4\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e1\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003eEats ingredient 1 in the pot\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e$$$\\{2\\}$$$\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e5\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e2\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003eEats ingredient 2 in the pot\u003c/td\u003e\u003ctd class\u003d\"tex-tabular-border-left tex-tabular-text-align-center tex-tabular-border-right tex-tabular-border-top tex-tabular-border-bottom\"\u003e$$$\\{\\}$$$\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e \u003c/center\u003e"}}]}