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;
using namespace std;
struct Point {
  long double x, y;
  Point(long double x, long double y) : x(x), y(y) {}
};
long double p2p(Point c1, Point c2) {
  return sqrt((c1.x - c2.x) * (c1.x - c2.x) + (c1.y - c2.y) * (c1.y - c2.y));
}
long double area(Point c1, long double r1, Point c2, long double r2) {
  long double dis = p2p(c1, c2);
  if (dis > r1 + r2 - (long double)1e-14)
    return 0;
  else if (dis - (long double)1e-14 < abs(r1 - r2))
    return min(r1, r2) * min(r1, r2) * acos(-1.0);
  else {
    long double a = dis, b = r1, c = r2;
    long double cta1 = acos((a * a + b * b - c * c) / 2 / (a * b));
    long double cta2 = acos((a * a + c * c - b * b) / 2 / (a * c));
    long double s1 = r1 * r1 * cta1 - r1 * r1 * sin(cta1) *
                                          (a * a + b * b - c * c) / 2 / (a * b);
    long double s2 = r2 * r2 * cta2 - r2 * r2 * sin(cta2) *
                                          (a * a + c * c - b * b) / 2 / (a * c);
    return s1 + s2;
  }
}
int main() {
  long double x1, y1, r1, x2, y2, r2;
  cin >> x1 >> y1 >> r1 >> x2 >> y2 >> r2;
  printf("%.14f", (double)area(Point(x1, y1), r1, Point(x2, y2), r2));
}