{"trustable":true,"sections":[{"title":"Description","value":{"format":"MD","content":"有一个长为 $n$ 的序列 $a$,以及一个大小为 $k$ 的窗口。现在这个从左边开始向右滑动,每次滑动一个单位,求出每次滑动后窗口中的最大值和最小值。\n\n例如,对于序列 $[1,3,-1,-3,5,3,6,7]$ 以及 $k \u003d 3$,有如下过程:\n\n$$\\def\\arraystretch{1.2}\n\\begin{array}{|c|c|c|}\\hline\n\\textsf{窗口位置} \u0026 \\textsf{最小值} \u0026 \\textsf{最大值} \\\\ \\hline\n\\verb![1 3 -1] -3 5 3 6 7 ! \u0026 -1 \u0026 3 \\\\ \\hline\n\\verb! 1 [3 -1 -3] 5 3 6 7 ! \u0026 -3 \u0026 3 \\\\ \\hline\n\\verb! 1 3 [-1 -3 5] 3 6 7 ! \u0026 -3 \u0026 5 \\\\ \\hline\n\\verb! 1 3 -1 [-3 5 3] 6 7 ! \u0026 -3 \u0026 5 \\\\ \\hline\n\\verb! 1 3 -1 -3 [5 3 6] 7 ! \u0026 3 \u0026 6 \\\\ \\hline\n\\verb! 1 3 -1 -3 5 [3 6 7]! \u0026 3 \u0026 7 \\\\ \\hline\n\\end{array}\n$$"}},{"title":"Input","value":{"format":"MD","content":"输入一共有两行,第一行有两个正整数 $n,k$。\n第二行 $n$ 个整数,表示序列 $a$\n"}},{"title":"Output","value":{"format":"MD","content":"输出共两行,第一行为每次窗口滑动的最小值 \n第二行为每次窗口滑动的最大值 \n"}},{"title":"Sample 1","value":{"format":"MD","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\u003e8 3\n1 3 -1 -3 5 3 6 7\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e-1 -3 -3 -3 3 3\n3 3 5 5 6 7\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Hint","value":{"format":"MD","content":"【数据范围】 \n对于 $50\\%$ 的数据,$1 \\le n \\le 10^5$; \n对于 $100\\%$ 的数据,$1\\le k \\le n \\le 10^6$,$a_i \\in [-2^{31},2^{31})$。\n"}}]}