{"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\n\u003cscript\u003e\n window.katexOptions \u003d {\n disable: true\n };\n\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\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eYou have two permutations of $$$n$$$ elements, $$$p_1, p_2, \\ldots, p_n$$$ and $$$q_1, q_2, \\ldots, q_n$$$, and one integer $$$k$$$.\u003c/p\u003e\n\u003cp\u003eYou need to find two integer arrays, $$$a$$$ and $$$b$$$, with the following properties:\u003c/p\u003e\n\u003cul\u003e\n \u003cli\u003eThe elements of the arrays must be integers such that $$$-n \\leq a_i, b_i \\leq n$$$.\u003c/li\u003e\n \u003cli\u003eThe permutations induce the following order: $$$a_{p_1} \\leq a_{p_2} \\leq \\ldots \\leq a_{p_n}$$$ and $$$b_{q_1} \\leq b_{q_2} \\leq \\ldots \\leq b_{q_n}$$$.\u003c/li\u003e\n \u003cli\u003eA pair $$$(i, j)$$$ is \u003cspan class\u003d\"tex-font-style-bf\"\u003ecool\u003c/span\u003e if $$$i \u0026lt; j$$$ and $$$a_i + b_j \u0026lt; 0$$$. The number of cool pairs must be exactly $$$k$$$.\u003c/li\u003e\n\u003c/ul\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line of the input contains two integers $$$n$$$ and $$$k$$$: the number of elements and the required number of cool pairs ($$$1 \\leq n \\leq 300\\,000$$$, $$$0 \\leq k \\leq \\frac{n \\cdot (n - 1)}{2}$$$).\u003c/p\u003e\n\u003cp\u003eThe second line contains $$$n$$$ space-separated integers: the permutation $$$p_1, p_2, \\ldots, p_n$$$.\u003c/p\u003e\n\u003cp\u003eThe third line contains $$$n$$$ space-separated integers: the permutation $$$q_1, q_2, \\ldots, q_n$$$.\u003c/p\u003e\n\u003cp\u003eIt is guaranteed that each integer from $$$1$$$ to $$$n$$$ appears exactly once in each permutation.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eIf there is no such pair of integer arrays that the number of cool pairs is equal to $$$k$$$, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eNo\u003c/span\u003e\" on a single line.\u003c/p\u003e\n\u003cp\u003eOtherwise, print \"\u003cspan class\u003d\"tex-font-style-tt\"\u003eYes\u003c/span\u003e\" on the first line, and print the arrays $$$a$$$ and $$$b$$$ on the next two lines. Separate array elements by spaces.\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\u003e5 3\n3 5 1 2 4\n1 2 3 4 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003eYes\n2 3 -1 5 1\n-5 -3 -2 -2 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}