Problem: 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 α.

<image>

Your task is to find the area of the region which belongs to both given rectangles. This region is shaded in the picture.

Input

The first line contains three integers w, h, α (1 ≤ w, h ≤ 106; 0 ≤ α ≤ 180). Angle α is given in degrees.

Output

In a single line print a real number — the area of the region which belongs to both given rectangles.

The answer will be considered correct if its relative or absolute error doesn't exceed 10 - 6.

Examples

Input

1 1 45


Output

0.828427125


Input

6 4 30


Output

19.668384925

Note

The second sample has been drawn on the picture above.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long double PI = 4 * atan(1.0);
int main() {
  long double n, a, w, h, b, c, e, f, g, x, y, a1, a2, b1, b2, c1, c2, d, d1,
      d2, xx5, yy5, sum = 0;
  cin >> w >> h >> a;
  cout.precision(7);
  if (a == 0 || a == 180) {
    cout << fixed << w * h;
    return 0;
  }
  vector<long double> xx;
  vector<long double> yy;
  long double sina = sin(a * PI / 180);
  long double cosa = cos(a * PI / 180);
  x = -w / 2;
  y = -h / 2;
  long double x5 = x, x5a;
  long double x2 = x + w, x2a;
  long double x3 = x + w, x3a;
  long double x4 = x, x4a;
  long double y5 = y, y5a;
  long double y2 = y, y2a;
  long double y3 = y + h, y3a;
  long double y4 = y + h, y4a;
  long double xo = x + (w / 2);
  long double yo = y + (h / 2);
  x5a = ((x5 - xo) * cosa - (y5 - yo) * sina) + xo;
  y5a = ((x5 - xo) * sina + (y5 - yo) * cosa) + yo;
  x2a = ((x2 - xo) * cosa - (y2 - yo) * sina) + xo;
  y2a = ((x2 - xo) * sina + (y2 - yo) * cosa) + yo;
  x3a = ((x3 - xo) * cosa - (y3 - yo) * sina) + xo;
  y3a = ((x3 - xo) * sina + (y3 - yo) * cosa) + yo;
  x4a = ((x4 - xo) * cosa - (y4 - yo) * sina) + xo;
  y4a = ((x4 - xo) * sina + (y4 - yo) * cosa) + yo;
  a1 = y2 - y5;
  b1 = x5 - x2;
  c1 = -((x2 - x5) * y5 - (y2 - y5) * x5);
  a2 = y2a - y5a;
  b2 = x5a - x2a;
  c2 = b2 * y5a + a2 * x5a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y3 - y2;
  b1 = x2 - x3;
  c1 = -((x3 - x2) * y2 - (y3 - y2) * x2);
  a2 = y2a - y5a;
  b2 = x5a - x2a;
  c2 = b2 * y5a + a2 * x5a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y4 - y3;
  b1 = x3 - x4;
  c1 = -((x4 - x3) * y3 - (y4 - y3) * x3);
  a2 = y2a - y5a;
  b2 = x5a - x2a;
  c2 = b2 * y5a + a2 * x5a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y5 - y4;
  b1 = x4 - x5;
  c1 = -((x5 - x4) * y4 - (y5 - y4) * x4);
  a2 = y2a - y5a;
  b2 = x5a - x2a;
  c2 = b2 * y5a + a2 * x5a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y3 - y2;
  b1 = x2 - x3;
  c1 = -((x3 - x2) * y2 - (y3 - y2) * x2);
  a2 = y3a - y2a;
  b2 = x2a - x3a;
  c2 = b2 * y2a + a2 * x2a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y4 - y3;
  b1 = x3 - x4;
  c1 = -((x4 - x3) * y3 - (y4 - y3) * x3);
  a2 = y3a - y2a;
  b2 = x2a - x3a;
  c2 = b2 * y2a + a2 * x2a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y5 - y4;
  b1 = x4 - x5;
  c1 = -((x5 - x4) * y4 - (y5 - y4) * x4);
  a2 = y3a - y2a;
  b2 = x2a - x3a;
  c2 = b2 * y2a + a2 * x2a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y2 - y5;
  b1 = x5 - x2;
  c1 = -((x2 - x5) * y5 - (y2 - y5) * x5);
  a2 = y3a - y2a;
  b2 = x2a - x3a;
  c2 = b2 * y2a + a2 * x2a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y4 - y3;
  b1 = x3 - x4;
  c1 = -((x4 - x3) * y3 - (y4 - y3) * x3);
  a2 = y4a - y3a;
  b2 = x3a - x4a;
  c2 = b2 * y3a + a2 * x3a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y5 - y4;
  b1 = x4 - x5;
  c1 = -((x5 - x4) * y4 - (y5 - y4) * x4);
  a2 = y4a - y3a;
  b2 = x3a - x4a;
  c2 = b2 * y3a + a2 * x3a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y2 - y5;
  b1 = x5 - x2;
  c1 = -((x2 - x5) * y5 - (y2 - y5) * x5);
  a2 = y4a - y3a;
  b2 = x3a - x4a;
  c2 = b2 * y3a + a2 * x3a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y3 - y2;
  b1 = x2 - x3;
  c1 = -((x3 - x2) * y2 - (y3 - y2) * x2);
  a2 = y4a - y3a;
  b2 = x3a - x4a;
  c2 = b2 * y3a + a2 * x3a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y5 - y4;
  b1 = x4 - x5;
  c1 = -((x5 - x4) * y4 - (y5 - y4) * x4);
  a2 = y5a - y4a;
  b2 = x4a - x5a;
  c2 = b2 * y4a + a2 * x4a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y2 - y5;
  b1 = x5 - x2;
  c1 = -((x2 - x5) * y5 - (y2 - y5) * x5);
  a2 = y5a - y4a;
  b2 = x4a - x5a;
  c2 = b2 * y4a + a2 * x4a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y3 - y2;
  b1 = x2 - x3;
  c1 = -((x3 - x2) * y2 - (y3 - y2) * x2);
  a2 = y5a - y4a;
  b2 = x4a - x5a;
  c2 = b2 * y4a + a2 * x4a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  a1 = y4 - y3;
  b1 = x3 - x4;
  c1 = -((x4 - x3) * y3 - (y4 - y3) * x3);
  a2 = y5a - y4a;
  b2 = x4a - x5a;
  c2 = b2 * y4a + a2 * x4a;
  d = a1 * b2 - b1 * a2;
  d1 = c1 * b2 - b1 * c2;
  d2 = a1 * c2 - c1 * a2;
  if (d != 0 && d1 / d < w / 2 + 00000000.1 && d1 / d > -w / 2 - 00000000.1 &&
      d2 / d < h / 2 + 00000000.1 && d2 / d >= -h / 2 - 00000000.1) {
    xx5 = d1 / d;
    yy5 = d2 / d;
    xx.push_back(xx5);
    yy.push_back(yy5);
  }
  for (int i = 0; i < xx.size(); i++) {
    if (i != xx.size() - 1)
      sum += xx[i] * yy[i + 1] - xx[i + 1] * yy[i];
    else
      sum += xx[i] * yy[0] - xx[0] * yy[i];
  }
  cout << fixed << abs(sum / 2.0);
}