Given counts of four stick orientations (horizontal, vertical, and two diagonals), arrange all of them as the sides of a simple lattice polygon and minimize its area.
Mirko read about Pick's theorem. Draw a polygon in the coordinate plane whose vertices are all lattice points, let A be its area, let i be the number of lattice points strictly inside the polygon, and let p be the number of lattice points on its edges. The vertices count as lattice points on the edges. Then the following always holds.
A=i+2p−1
Figure 1: this polygon has A=8, i=4, p=10.
To check the theorem, Mirko decided to build a polygon out of magnetic sticks on his magnetic board. During the night the sticks slid to the bottom of the board because of gravity. Mirko collected the following sticks.
a horizontal sticks of length 1
b vertical sticks of length 1
c diagonal sticks of length 2 that form a 45∘ angle with the positive direction of the x-axis
d diagonal sticks of length 2 that form a 135∘ angle with the positive direction of the x-axis
Figure 2: the sticks Mirko collected.
Mirko can move a stick anywhere on the board, but he cannot rotate it. He has to use every collected stick in one polygon, and each stick becomes one side of that polygon. All vertices of the polygon are lattice points, and two neighbouring sides may be parallel. The polygon must not touch or intersect itself.
Find the smallest area a polygon built this way can have.
Input
The first line contains four integers a, b, c, d, separated by spaces.
Output
Print the smallest area of a polygon that uses all of the sticks, with exactly one digit after the decimal point. The smallest area is always a multiple of 0.5, so this format is exact.
Constraints
0≤a,b,c,d≤100
a+b+c+d≥3
The given sticks can build at least one polygon that meets the conditions.