{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eIt is year 2500 A.D. and there is a terrible war between the forces of the Earth and the Mars. Recently, the commanders of the Earth are informed by their spies that the invaders of Mars want to land some paratroopers in the \u003ci\u003em \u003c/i\u003e×\u003ci\u003e n\u003c/i\u003e grid yard of one their main weapon factories in order to destroy it. In addition, the spies informed them the row and column of the places in the yard in which each paratrooper will land. Since the paratroopers are very strong and well-organized, even one of them, if survived, can complete the mission and destroy the whole factory. As a result, the defense force of the Earth must kill all of them simultaneously after their landing.\u003c/p\u003e\u003cp\u003eIn order to accomplish this task, the defense force wants to utilize some of their most hi-tech laser guns. They can install a gun on a row (resp. column) and by firing this gun all paratroopers landed in this row (resp. column) will die. The cost of installing a gun in the \u003ci\u003ei\u003c/i\u003eth row (resp. column) of the grid yard is \u003ci\u003er\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e (resp. \u003ci\u003ec\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e ) and the total cost of constructing a system firing all guns simultaneously is equal to the product of their costs. Now, your team as a high rank defense group must select the guns that can kill all paratroopers and yield minimum total cost of constructing the firing system.\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eInput begins with a number \u003ci\u003eT\u003c/i\u003e showing the number of test cases and then, \u003ci\u003eT\u003c/i\u003e test cases follow. Each test case begins with a line containing three integers 1 ≤ \u003ci\u003em\u003c/i\u003e ≤ 50 , 1 ≤ \u003ci\u003en\u003c/i\u003e ≤ 50 and 1 ≤ \u003ci\u003el\u003c/i\u003e ≤ 500 showing the number of rows and columns of the yard and the number of paratroopers respectively. After that, a line with \u003ci\u003em\u003c/i\u003e positive real numbers greater or equal to 1.0 comes where the \u003ci\u003ei\u003c/i\u003eth number is \u003ci\u003er\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e and then, a line with \u003ci\u003en\u003c/i\u003e positive real numbers greater or equal to 1.0 comes where the \u003ci\u003ei\u003c/i\u003eth number is \u003ci\u003ec\u003csub\u003ei\u003c/sub\u003e\u003c/i\u003e. Finally, \u003ci\u003el\u003c/i\u003e lines come each containing the row and column of a paratrooper.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, your program must output the minimum total cost of constructing the firing system rounded to four digits after the fraction point.\u003c/p\u003e"}},{"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\u003e1\r\n4 4 5\r\n2.0 7.0 5.0 2.0\r\n1.5 2.0 2.0 8.0\r\n1 1\r\n2 2\r\n3 3\r\n4 4\r\n1 4\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e16.0000\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}