New Matryoshka
题号:NC15540
时间限制:C/C++/Rust/Pascal 3秒,其他语言6秒
空间限制:C/C++/Rust/Pascal 128 M,其他语言256 M
64bit IO Format: %lld

题目描述

Russian Matryoshka is a wooden toy of Russia’s specialties. It is usually made up of a set of one or more wooden dolls of the same pattern, with a flat bottom that can stand upright. Colors are red, blue, green, purple, etc. The most common pattern is a girl dressed in Russian national costume called ”Matroska”, which also became the generic name of this doll.

Rainbow Island has it’s own Matryoshka, but it is different from the Matryoshka in Russia. It’s composition rules are as follows:
1. The wooden doll is a two-dimensional figure with only two shapes, circle or square.
2. When two dolls are tangent to one another, the small one can be put into the the big one. For example, a circle with a radius of 2 can be put into a square with sides of 4.
3. Square dolls with side length of x can be put into another square dolls with side length of y when x ≤ y. So as circle dolls.
4. A doll can be put into only one doll (but can be put continuously, which means doll A can be put into doll B, and the B with A can be put into doll C, while A and B couldn’t be put into C separately).
5. The thickness of all dolls can be ignored.
6. If doll A has been put into doll B, the area of the final doll is the area of B. For example, a circle with a radius of 2 has been put into a square with sides of 4, and the final area is 16.
The well-known black heart businessman ctr is going to ShuHui Yuan for money with his dolls (there are n circle with the radius of ri, m square with the side length of ai). In order to to carry more dolls, he want to put some of them into the others to make the final area minimum.
Can you tell him what is the minimum final area?

输入描述:

The first line contains an integer number T, the number of test cases.
For each test case :
The first line contains two integers n,m(1 ≤ n + m ≤ 200), the number of circle and square dolls.
The following m lines, each contains n integers ai(1 ≤ ai≤ 105), the side length of the ith square doll.
The following lines, each contains m integers ri(1 ≤ ri≤ 105), the radius of the ith circle doll.

输出描述:

For each test case print the minimum final area, round to two decimal places.
示例1

输入

复制
2
5 0
4 5 5 4 2
3 2
10 7 4
5 4

输出

复制
25.00
149.00