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 double PI = acos(-1);
struct cir {
  long double x, y, r;
} c1, c2;
long double area(cir x) { return PI * x.r * x.r; };
int connection() {
  long double dis =
      abs(complex<long double>(c1.x, c1.y) - complex<long double>(c2.x, c2.y));
  if (dis + c1.r <= c2.r) return 1;
  if (dis + c2.r <= c1.r) return 1;
  if (dis >= c1.r + c2.r) return 0;
  return -1;
}
long double c_area() {
  long double d =
      abs(complex<long double>(c1.x, c1.y) - complex<long double>(c2.x, c2.y));
  long double r1 = c1.r, r2 = c2.r;
  long double g1 =
      2 * acos(((r1 - r2) * (r1 + r2) + (d) * (d)) / (2.0 * r1 * d));
  long double g2 =
      2 * acos(((r2 - r1) * (r1 + r2) + (d) * (d)) / (2.0 * r2 * d));
  long double d1 = ((r1) * (r1) * (g1 - sin(g1))) / 2.0;
  long double d2 = ((r2) * (r2) * (g2 - sin(g2))) / 2.0;
  long double dd = d1 + d2;
  return dd;
}
int main() {
  cin >> c1.x >> c1.y >> c1.r;
  cin >> c2.x >> c2.y >> c2.r;
  long double ans;
  int con = connection();
  if (con == 1)
    ans = min(area(c1), area(c2));
  else if (con == 0)
    ans = 0;
  else
    ans = c_area();
  cout << setprecision(10) << ans << endl;
}