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 PI = 3.14159265358979323846264338324990142;
const long double EPS = 1e-12;
inline long double cal(long double x, long double y, long double xx,
                       long double yy) {
  return sqrt((x - xx) * (x - xx) + (y - yy) * (y - yy));
}
inline long double GetAng(long double a, long double b, long double c) {
  return acos((a * a + b * b - c * c) / (2 * a * b));
}
int main() {
  long double x, y, r, xx, yy, rr;
  cin >> x >> y >> r >> xx >> yy >> rr;
  long double dis = cal(1.0 * x, 1.0 * y, 1.0 * xx, 1.0 * yy);
  if (dis >= r + rr)
    puts("0");
  else if (dis <= abs(r - rr)) {
    long double ans = min(r, rr);
    cout << setprecision(20) << ans * ans * PI << endl;
  } else {
    long double ang1 = GetAng(dis, 1.0 * r, 1.0 * rr),
                ang2 = GetAng(dis, 1.0 * rr, 1.0 * r);
    long double ans = ang1 * r * r + ang2 * rr * rr -
                      r * r * sin(ang1) * cos(ang1) -
                      rr * rr * sin(ang2) * cos(ang2);
    cout << setprecision(20) << ans << endl;
  }
  return 0;
}