The Hilbert mole is a small and very rare animal. Hilbert found the first and only specimen in his own back yard. The mole lives in a huge burrow under the ground, and the border of that burrow is a Hilbert curve of order $n$, written $H_n$.
Hilbert curves are defined as follows. $H_1$ is a unit square with its top side removed (fig. 1a). $H_n$ consists of four copies of $H_{n-1}$: the bottom left and the bottom right copy are placed unchanged, the top left copy is turned 90 degrees counterclockwise, and the top right copy is turned 90 degrees clockwise. Three segments of unit length join the four copies (fig. 1b, 1c, 1d). The finished curve fits in a square of side $2^n - 1$, and its two ends are the two upper corners of that square.
![]() | ![]() | ![]() | ![]() |
| a | b | c | d |
Fig. 1. Hilbert curves, order 1 to 4.
The ground surface is the straight line through the two ends of the curve. It makes an angle of $\alpha$ degrees with the horizontal and rises toward the end of the curve. Below the surface everything is earth except the burrow. A point below the surface belongs to the burrow when the segment drawn from it to the surface, perpendicular to the surface, meets the curve an even number of times. Where the burrow reaches the surface it is open, so water gets in there.
Trying to exterminate the mole, Mr. Hilbert pours water over the whole surface (fig. 2). Air left inside the burrow keeps the water from filling it entirely. Air and water are incompressible and cannot leak through the walls of the burrow. Water that comes back out to the surface runs down the slope and is gone. Find the total area of the burrow that ends up filled with water.

Fig. 2. Burrow, filled with water.
Water flows over an obstacle only when its level is strictly higher than the obstacle. See the examples in fig. 3 for further clarification.

Fig. 3. More examples of filled burrows.
The first line contains two integers $n$ and $\alpha$: the order of the Hilbert curve and the slope angle of the surface in degrees ($1 \le n \le 12$, $0 \le \alpha < 90$).
Print the total area of the burrow that is filled with water, with exactly four digits after the decimal point. In every test the answer is at least $10^{-6}$ away from a rounding boundary, so the last digit is never ambiguous.