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>
typedef struct {
  long long x, y, r;
} circle;
int main() {
  circle a, b;
  long long dsq;
  long double d, al, cos_al, be, cos_be, out;
  std::cin >> a.x >> a.y >> a.r;
  std::cin >> b.x >> b.y >> b.r;
  dsq = (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
  d = sqrt(dsq);
  if ((a.r - b.r) * (a.r - b.r) >= dsq)
    out = acosl(-1) * std::min(a.r, b.r) * std::min(a.r, b.r);
  else if (dsq >= (a.r + b.r) * (a.r + b.r))
    out = 0;
  else {
    cos_al = (b.r * b.r - a.r * a.r + dsq) / (b.r * 2 * d);
    al = acosl(cos_al);
    out = (b.r * b.r) * (al - cosl(al) * sinl(al));
    cos_be = (a.r * a.r - b.r * b.r + dsq) / (a.r * 2 * d);
    be = acosl(cos_be);
    out += (a.r * a.r) * (be - cosl(be) * sinl(be));
  }
  std::cout << std::setprecision(15) << out;
}