{"trustable":false,"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"MD","content":"有 $ q $ 组数据,每组第一排表示有 $ n $ 个方格和 $ k $ 个空调,第二排是每个空调的位置 $ a_i $ ,第三排是每个空调的温度 $ t_i $ 。 \n每个空调对周围的影响是递减的,所以一个空调周围的温度是公差为 $ 1 $ 的递增等差数列。如果一个方格同时被多个空调影响,那么取最小值。空调所在的方格温度就是空调的温度。 "}},{"title":"Input","value":{"format":"MD","content":"$ 1 \\le q \\le 10^4 , 1 \\le n \\le 3 \\cdot 10^5 , 1 \\le k \\le n , 1 \\le a_i \\le n , 1 \\le t_i \\le 10^9 $ , 保证所有 $ n $ 的总和不超过 $ 3 \\cdot 10^5 $ 。"}},{"title":"Output","value":{"format":"MD","content":"对于每个测试数据,输出 $$$n$$$ 个正整数代表所有方格的温度。 "}},{"title":"Example","value":{"format":"MD","content":"\u003cdiv class\u003d\"sample-test\"\u003e\n \u003cdiv class\u003d\"input\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Input\n \u003c/div\u003e\n \u003cpre\u003e5\n\n6 2\n2 5\n14 16\n\n10 1\n7\n30\n\n5 5\n3 1 4 2 5\n3 1 4 2 5\n\n7 1\n1\n1000000000\n\n6 3\n6 1 3\n5 5 5\n\u003c/pre\u003e\n \u003c/div\u003e\n \u003cdiv class\u003d\"output\"\u003e\n \u003cdiv class\u003d\"title\"\u003e\n Output\n \u003c/div\u003e\n \u003cpre\u003e15 14 15 16 16 17 \n36 35 34 33 32 31 30 31 32 33 \n1 2 3 4 5 \n1000000000 1000000001 1000000002 1000000003 1000000004 1000000005 1000000006 \n5 6 5 6 6 5 \n\u003c/pre\u003e\n \u003c/div\u003e\n\u003c/div\u003e"}}]}