{"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\"\u003eYou are playing CSGO.\u003cbr\u003eThere are n Main Weapons and m Secondary Weapons in CSGO. You can only choose one Main Weapon and one Secondary Weapon. For each weapon, it has a composite score S.\u003cbr\u003eThe higher the composite score of the weapon is, the better for you.\u003cbr\u003eAlso each weapon has K performance evaluations x[1], x[2], …, x[K].(range, firing rate, recoil, weight…)\u003cbr\u003eSo you shold consider the cooperation of your weapons, you want two weapons that have big difference in each performance, for example, AWP + CZ75 is a good choose, and so do AK47 + Desert Eagle.\u003cbr\u003eAll in all, you will evaluate your weapons by this formula.(MW for Main Weapon and SW for Secondary Weapon)\u003cbr\u003e\u003ccenter\u003e\u003cimg style\u003d\"max-width:100%;\" src\u003d\"CDN_BASE_URL/f06cec09a661ac0ae2e7c16c9288a5a6?v\u003d1715739105\"\u003e\u003c/center\u003e\u003cbr\u003eNow you have to choose your best Main Weapon \u0026amp; Secondary Weapon and output the maximum evaluation.\u003c/div\u003e"}},{"title":"Input","value":{"format":"HTML","content":"Multiple query.\u003cbr\u003eOn the first line, there is a positive integer T, which describe the number of data. Next there are T groups of data.\u003cbr\u003efor each group, the first line have three positive integers n, m, K.\u003cbr\u003ethen, the next n line will describe n Main Weapons, K+1 integers each line S, x[1], x[2], …, x[K]\u003cbr\u003ethen, the next m line will describe m Secondary Weapons, K+1 integers each line S, x[1], x[2], …, x[K]\u003cbr\u003eThere is a blank line before each groups of data.\u003cbr\u003eT\u0026lt;\u003d100, n\u0026lt;\u003d100000, m\u0026lt;\u003d100000, K\u0026lt;\u003d5, 0\u0026lt;\u003dS\u0026lt;\u003d1e9, |x[i]|\u0026lt;\u003d1e9, sum of (n+m)\u0026lt;\u003d300000\u003cbr\u003e"}},{"title":"Output","value":{"format":"HTML","content":"Your output should include T lines, for each line, output the maximum evaluation for the corresponding datum."}},{"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\u003e2\r\n2 2 1\r\n0 233\r\n0 666\r\n0 123\r\n0 456\r\n2 2 1\r\n100 0 1000 100 1000 100\r\n100 0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e543\r\n2000\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}