Problem: You are given two circles. Find the area of their intersection.

Input

The first line contains three integers x1, y1, r1 ( - 109 ≤ x1, y1 ≤ 109, 1 ≤ r1 ≤ 109) — the position of the center and the radius of the first circle.

The second line contains three integers x2, y2, r2 ( - 109 ≤ x2, y2 ≤ 109, 1 ≤ r2 ≤ 109) — the position of the center and the radius of the second circle.

Output

Print the area of the intersection of the circles. The answer will be considered correct if the absolute or relative error doesn't exceed 10 - 6.

Examples

Input

0 0 4
6 0 4


Output

7.25298806364175601379


Input

0 0 5
11 0 5


Output

0.00000000000000000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long double pi = acos(0) * 2;
long double l(long double c, long double r) {
  long double w;
  w = 2 * acos(c / r);
  return w * r * r / 2 - c * r * sin(w / 2);
}
int main() {
  int q, w, e;
  long double c, c0, c1, v, v1, r, r1, t, y, ans1, ans2, ans;
  cin >> c >> v >> r;
  cin >> c1 >> v1 >> r1;
  if (r < r1) {
    t = c;
    c = c1;
    c1 = t;
    t = v;
    v = v1;
    v1 = t;
    t = r;
    r = r1;
    r1 = t;
  }
  y = sqrt((c - c1) * (c - c1) + (v - v1) * (v - v1));
  if (r >= y + r1) {
    printf("%.10f", ((double)(r1 * r1 * pi)));
    return 0;
  }
  if (y >= r + r1) {
    cout << "0";
    return 0;
  }
  c0 = (r * r + y * y - r1 * r1) / (y * 2);
  ans1 = l(c0, r);
  ans2 = l(y - c0, r1);
  if ((r1 >= y) && (r1 < y))
    ans = r1 * r1 * pi - ans1 + ans2;
  else
    ans = ans1 + ans2;
  printf("%.10f", ((double)ans));
  return 0;
}