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;
template <typename T>
T nextInt() {
  T x = 0, p = 1;
  char ch;
  do {
    ch = getchar();
  } while (ch <= ' ');
  if (ch == '-') {
    p = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = x * 10 + (ch - '0');
    ch = getchar();
  }
  return x * p;
}
const int maxN = (int)3e5 + 10;
const int INF = (int)1e9;
const int mod = (int)1e9 + 7;
const long long LLINF = (long long)1e18;
const long double pi = acos(-1.0);
int x[2];
int y[2];
int r[2];
long double d;
long double solve(int xa, int ya, int ra, int xb, int yb, int rb) {
  long double angle =
      2 * acos((rb * 1LL * rb - ra * 1LL * ra - d * d) / (-2 * ra * d));
  return pi * ra * ra * angle / (2 * pi) - 1LL * ra * ra * sin(angle) / 2;
}
int main() {
  cin >> x[0] >> y[0] >> r[0] >> x[1] >> y[1] >> r[1];
  d = sqrtl((x[0] - x[1]) * 1LL * (x[0] - x[1]) +
            (y[0] - y[1]) * 1LL * (y[0] - y[1]));
  cout.precision(21);
  if (d >= r[0] + r[1]) {
    cout << 0 << '\n';
    return 0;
  }
  if (d <= abs(r[0] - r[1])) {
    cout << pi * min(r[0], r[1]) * min(r[0], r[1]) << '\n';
    return 0;
  }
  cout << solve(x[0], y[0], r[0], x[1], y[1], r[1]) +
              solve(x[1], y[1], r[1], x[0], y[0], r[0])
       << '\n';
  return 0;
}