{"trustable":true,"sections":[{"title":"Description","value":{"format":"MD","content":"There is a sequence of length $n$, denoted as $a$, and a window of size $k$. Now the window slides from left to right, moving one unit at a time, and we need to find the maximum and minimum values in the window after each slide.\n\nFor example, for the sequence $[1,3,-1,-3,5,3,6,7]$ and window size $k \u003d 3$, the process is as follows:\n\n$$\\def\\arraystretch{1.2}\n\\begin{array}{|c|c|c|}\\hline\n\\textsf{Window Position} \u0026 \\textsf{Minimum Value} \u0026 \\textsf{Maximum Value} \\\\ \\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":"The input consists of two lines. The first line contains two positive integers $n,k$.\nThe second line contains $n$ integers, representing the sequence $a$."}},{"title":"Output","value":{"format":"MD","content":"Output two lines. The first line contains the minimum value after each window slide. \nThe second line contains the maximum value after each window slide."}},{"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"}},{"title":"Hint","value":{"format":"MD","content":"【Data Constraints】 \nFor $50\\%$ data, $1 \\le n \\le 10^5$; \nFor $100\\%$ data, $1\\le k \\le n \\le 10^6$, $a_i \\in [-2^{31},2^{31})$."}}]}