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>
template <class T>
void RD(T& ret) {
  ret = 0;
  bool ok = 0, u = 0;
  for (;;) {
    int c = getchar();
    if (c >= '0' && c <= '9')
      ret = (ret << 3) + (ret << 1) + c - '0', ok = 1;
    else if (c == '-')
      u = 1;
    else if (ok) {
      if (u) ret *= -1;
      return;
    }
  }
}
long long pow_mod(long long p, long long n, long long mod) {
  long long ret = 1;
  for (; n; n >>= 1) {
    if (n & 1) ret = ret * p % mod;
    p = p * p % mod;
  }
  return ret;
}
template <class T>
bool chmin(T& a, const T& b) {
  return b < a ? a = b, 1 : 0;
}
template <class T>
bool chmax(T& a, const T& b) {
  return b > a ? a = b, 1 : 0;
}
using namespace std;
const long double pi = 2 * acos(0.0);
const long double eps = 1e-6;
struct pnt {
  long double first, second;
};
struct ccl {
  pnt o;
  long double r;
  ccl() {}
  ccl(pnt a, long double b) : o(a), r(b) {}
  void rd() {
    double first, second, _r;
    scanf("%lf%lf%lf", &first, &second, &_r);
    o.first = first;
    o.second = second;
    r = _r;
  }
  friend ostream& operator<<(ostream& out, ccl& p) {
    out << "(" << p.o.first << "," << p.o.second << "," << p.r << ")";
    return out;
  }
};
long double dis(pnt a, pnt b) {
  return (a.first - b.first) * (a.first - b.first) +
         (a.second - b.second) * (a.second - b.second);
}
long double circleIntersectionArea(ccl c1, ccl c2) {
  if (c1.r < c2.r - eps) swap(c1, c2);
  long double d = dis(c1.o, c2.o);
  if (d >= (c1.r + c2.r) * (c1.r + c2.r) + eps) return 0;
  if (d <= (c1.r - c2.r) * (c1.r - c2.r) + eps) return pi * c2.r * c2.r;
  long double p, da, res = 0, dd = sqrt(d);
  p = ((long double)c1.r * c1.r + d - c2.r * c2.r) / 2 / c1.r / dd;
  da = acos(p) * 2;
  res += c1.r * c1.r * (da - sin(da)) / 2;
  swap(c1, c2);
  p = ((long double)c1.r * c1.r + d - c2.r * c2.r) / 2 / c1.r / dd;
  da = acos(p) * 2;
  res += c1.r * c1.r * (da - sin(da)) / 2;
  return res;
}
int main() {
  ccl c1, c2;
  c1.rd();
  c2.rd();
  printf("%.15f", (double)circleIntersectionArea(c1, c2));
  return 0;
}