You are given two rectangles on a plane. The centers of both rectangles are located in the origin of coordinates (meaning the center of the rectangle's symmetry). The first rectangle's sides are parallel to the coordinate axes: the length of the side that is parallel to the *Ox* axis, equals *w*, the length of the side that is parallel to the *Oy* axis, equals *h*. The second rectangle can be obtained by rotating the first rectangle relative to the origin of coordinates by angle α.

Your task is to find the area of the region which belongs to both given rectangles. This region is shaded in the picture.
The first line contains three integers *w*, *h*, α (1 ≤ *w*, *h* ≤ 10<sup class="upper-index">6</sup>; 0 ≤ α ≤ 180). Angle α is given in degrees.
import math
from dataclasses import dataclass


@dataclass
class Point:
    x: float
    y: float

    def __add__(self, other):
        return Point(self.x + other.x, self.y + other.y)

    def rotate(self, phi):
        x = self.x * math.cos(phi) - self.y * math.sin(phi)
        y = self.x * math.sin(phi) + self.y * math.cos(phi)
        return Point(x, y)

    def distance(self, other):
        return math.hypot(self.x - other.x, self.y - other.y)


@dataclass
class Line:
    p1: Point
    p2: Point

    @property
    def k(self):
        dy = self.p2.y - self.p1.y
        dx = self.p2.x - self.p1.x
        if dx == 0:
            return float('inf')
        return dy / dx

    @property
    def b(self):
        return self.p1.y - self.k * self.p1.x

    def cross(self, other):
        if self.k == other.k:
            return None
        elif math.isinf(self.k):
            x = self.p1.x
            y = other.k * x + other.b
        elif math.isinf(other.k):
            x = other.p1.x
            y = self.k * x + self.b
        else:
            x = (other.b - self.b) / (self.k - other.k)
            y = self.k * x + self.b
        return Point(x, y)

    def rotate(self, phi):
        return Line(self.p1.rotate(phi), self.p2.rotate(phi))


def main():
    w, h, a = map(int, input().split())
    phi = math.radians(a)
    if phi > math.pi / 2:
        phi = math.pi - phi

    rect_angle = 180 - 2 * math.atan(h / w)

    if abs(rect_angle - phi) < 1e-6:
        return solve_diagonal_rotated(w, h, phi)
    elif rect_angle < phi:
        return solve_4(w, h, phi)
    return solve_triangles(w, h, phi)


def solve_diagonal_rotated(w, h, phi):
    w_x = h / math.tan(phi)
    S = w * h - h * w_x
    print(S)


def solve_4(w, h, phi):
    T1 = Point(-w / 2, h / 2)
    T2 = Point(-w / 2, -h / 2)
    T_vec = Point(w, 0)
    W1_line = Line(T1, T1 + T_vec)
    W2_line = Line(T2, T2 + T_vec)
    W1r_line = W1_line.rotate(phi)
    W2r_line = W2_line.rotate(phi)
    A = W1_line.cross(W1r_line)
    B = W1_line.cross(W2r_line)
    zero = Point(0, 0)
    d1 = zero.distance(A)
    d2 = zero.distance(B)
    S = w * h - d1 * d2 / 2
    print(S)


def solve_triangles(w, h, phi):
    A = Point(-w / 2, -h / 2)
    B = Point(-w / 2, h / 2)
    C = Point(w / 2, h / 2)
    D = Point(w / 2, -h / 2)
    Ar = A.rotate(phi)
    Br = B.rotate(phi)
    Dr = D.rotate(phi)
    AB_line = Line(A, B)
    AD_line = Line(A, D)
    CD_line = Line(C, D)
    ArBr_line = Line(Ar, Br)
    ArDr_line = Line(Ar, Dr)
    K = AB_line.cross(ArBr_line)
    L = AD_line.cross(ArBr_line)
    M = AD_line.cross(ArDr_line)
    N = CD_line.cross(ArDr_line)
    AK = A.distance(K)
    AL = A.distance(L)
    DM = D.distance(M)
    DN = D.distance(N)
    S = w * h - AK * AL - DM * DN
    print(S)


main()
