{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e\u003ci\u003eI\u0027m going to give my scores fairly. It\u0027s just that some contestant deserves a fairer score... \u003c/i\u003e\u003cbr\u003e\u003cbr\u003egispzjz and zyb are participating in a contest, with $n$ referees awarding scores(according to their performance, usually) to them. For each contestant, each referee should name an integer in the interval $[1,h]$ as the score, and the final score of the contestant is the sum over all scores he gets after eliminating $s$ highest scores and $t$ lowest scores.\u003cbr\u003e\u003cbr\u003eAs one of the referees, you had a bet on gispzjz, so you want him to win this contest, but you also don\u0027t want this to look too obvious. Suppose you know the other $n-1$ referees have awarded scores $a_1,\\dots,a_{n-1}$ to gispzjz and $b_1,\\dots,b_{n-1}$ to zyb. You need to give out your scores $a_n$ and $b_n$ so that the final score of gispzjz is \u003cb\u003estrictly higher\u003c/b\u003e than zyb. If that\u0027s achievable, you also need to minimize $a_n-b_n$, conditioned on the final score of gispzjz is strictly higher than zyb.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"The first line contains a number $T(1\\leq T\\leq 12000)$, denoting the number of test cases.\u003cbr\u003e\u003cbr\u003eThe first line of each test case contains four integers $n,s,t,h(1\\leq n\\leq 10^5, 0\\leq s,t \\leq n-1, 1\\leq h \\leq 10^9)$, denoting the number of referees, the number of highest and lowest scores that need to be eliminated, and the scoring range for referees, respectively. It is guaranteed that $s+t\\leq n-1$.\u003cbr\u003e\u003cbr\u003eThen one line containing $n-1$ integers $a_1,...,a_{n-1}(1\\leq a_i\\leq h)$ follow, denoting the scores already awarded to gispzjz. \u003cbr\u003e\u003cbr\u003eThen another line containing $n-1$ integers $b_1,...,b_{n-1}(1\\leq b_i\\leq h)$ follow, denoting the scores already awarded to zyb. \u003cbr\u003e\u003cbr\u003eIt is guaranteed that $\\sum n\\leq 10^6$ over all test cases.\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"For each test case, if it\u0027s possible to make gispzjz\u0027s score strictly higher than zyb, then output the minimized $a_n-b_n$ in one line, otherwise output \"IMPOSSIBLE\"(without quotes) in one line."}},{"title":"Sample","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\u003e3\r\n3 1 1 4\r\n1 3\r\n2 4\r\n4 1 1 9\r\n4 4 5\r\n4 5 5\r\n4 1 1 9\r\n4 5 5\r\n4 4 5\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\r\nIMPOSSIBLE\r\n-4\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}