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:
-
The wooden doll is a two-dimensional figure with only two shapes, circle or square.
-
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.
-
Square dolls with side length of $x$ can be put into another square dolls with side length of $y$ when $x \leq y$. So as circle dolls.
-
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).
-
The thickness of all dolls can be ignored.
-
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 $ShuHuiYuan$ for money with his dolls (there are $n$ circle with the radius of $r_{i}$, $m$ square with the side length of $a_{i}$). 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?