{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eOver time, those coaches in BDN Collegiate Progranuning Contest split into two camps.The big danger is that, while optimists and pessimists battle it out, the environment of this area becomes ever more divided between universities with outstanding student resources surrounded by a vast neglected group of stagnation.\u003c/p\u003e\n\u003cp\u003eAmy and Bob, as the linchpins of these two camps respectively, decided to put the end to the rival. Now both camps hold $n$ coders and $n$ tea-bringers as the last resource on hand. They will form teams in pair that each team should consist of a coder and a tea-bringer. The power of a team is regarded as the sum of powers of both members.\u003c/p\u003e\n\u003cp\u003eNow Bob hired a spy and has got some information about the plan of his rival: the power of each team which will present for the enemy camp, and the corresponding unit of reputations that Bob would gain after beating this team. Naturally, he hopes to make the best arrangement of teams in his camp for more reputations.\u003c/p\u003e\n\u003cp\u003eThese two camps will have a collision soon, and their teams will fight \u003cstrong\u003eone on one in random order\u003c/strong\u003e. That is, we may have $n!$ different situations appearing in this collision. A team would triumphantly return if it has a higher power. When two teams of the same power meet, the one led by Amy would beat the rival by a neck.\u003c/p\u003e\n\u003cp\u003eCan you calculate the maximum expected unit of reputations that Bob will gain? To make the answer be an integer, you are asked to multiply the answer by $n$ and we guarantee that the expected number multiplied by $n$ should always be an integer.\u003c/p\u003e\n\u003ch3\u003eInput\u003c/h3\u003e\n\u003cp\u003eThe input contains five lines, and the first line is consist of an integer $n~(1\\le n \\le 400)$.\u003c/p\u003e\n\u003cp\u003eThe second line contains $n$ integers $a_1,a_2,\\cdots,a_n$ with $-10^{18}\\leq a_i\\leq 10^{18}$, indicating the powers of all the teams led by Amy.\u003c/p\u003e\n\u003cp\u003eThe third line contains $n$ integers $p_1,p_2,\\cdots,p_n$ with $1\\leq p_i\\leq 10000$, indicating the corresponding units of reputations that Bob would gain if these teams led by Amy are beaten.\u003c/p\u003e\n\u003cp\u003eThe fourth line contains $n$ integers $b_1,b_2,\\cdots,b_n$ with $-10^{18}\\leq b_i\\leq 10^{18}$, indicating the powers of all coders in the camp of Bob.\u003c/p\u003e\n\u003cp\u003eThe last line contains $n$ integers $c_1,c_2,\\cdots,c_n$ with $-10^{18}\\leq c_i\\leq 10^{18}$, indicating the powers of all tea-bringers in the camp of Bob.\u003c/p\u003e\n\u003ch3\u003eOutput\u003c/h3\u003e\n\u003cp\u003eOutput an integer in a single line indicating the maximum expected number of wins multiplied by $n$.\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\u003e4\n1 2 3 4\n1 1 1 1\n0 0 1 1\n0 1 1 2\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e3\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\u003cbr /\u003e"}}]}