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;
const long double eps = 1e-8;
const long double pi = acos(-1.0);
struct point {
  long double x, y, r;
  point() {}
  point(long double x, long double y) : x(x), y(y) {}
  point operator-(const point& a) { return point(x - a.x, y - a.y); }
};
long double dis(point& a, point& b) {
  long double x = a.x - b.x;
  long double y = a.y - b.y;
  return sqrt(x * x + y * y);
}
long double fan(long double a) { return a * a; }
long double f(long double a, long double b, long double c) {
  return acos((fan(a) + fan(b) - fan(c)) / 2.0 / a / b);
}
void solve(point a1, point a2) {
  long double d = dis(a1, a2);
  long double alp = f(a1.r, d, a2.r) * 2;
  long double beta = f(a2.r, d, a1.r) * 2;
  long double ans = alp * fan(a1.r) / 2 - fan(a1.r) * sin(alp) / 2 +
                    (beta * fan(a2.r) / 2 - fan(a2.r) * sin(beta) / 2);
  printf("%.20lf\n", (double)ans);
}
void show(point a) { cout << a.x << ' ' << a.y << ' ' << a.r << endl; }
int main() {
  point a1, a2;
  while (cin >> a1.x >> a1.y >> a1.r) {
    cin >> a2.x >> a2.y >> a2.r;
    long double d = dis(a1, a2);
    if (d > a1.r + a2.r) {
      printf("0.00000000000\n");
    } else if (d - fabs(a1.r - a2.r) < eps) {
      long double r = min(a1.r, a2.r);
      long double ans = pi * r * r;
      printf("%.20lf\n", (double)ans);
    } else
      solve(a1, a2);
  }
  return 0;
}