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>
#pragma comment(linker, "/STACK:102400000,102400000")
template <class T>
inline void gmax(T &a, T b) {
  if (b > a) a = b;
}
template <class T>
inline void gmin(T &a, T b) {
  if (b < a) a = b;
}
using namespace std;
const int N = 1e5 + 10, M = 2e6 + 10, Z = 1e9 + 7, maxint = 2147483647,
          ms1 = 16843009, ms31 = 522133279, ms63 = 1061109567,
          ms127 = 2139062143;
const double PI = acos(-1.0), eps = 1e-8;
void fre() {
  freopen("/Users/luras/Desktop/in.txt", "r", stdin);
  freopen("/Users/luras/Desktop/out.txt", "w", stdout);
}
const int INF = 1e9;
int casenum, casei;
struct circle {
  long double x, y, r;
} p1, p2;
long double sqr(long double x) { return x * x; }
long double dis(circle a, circle b) {
  return sqrt(sqr(a.x - b.x) + sqr(a.y - b.y));
}
long double solve(circle a, circle b) {
  long double d = dis(a, b);
  if (d >= a.r + b.r) return 0;
  if (d <= fabs(a.r - b.r)) {
    long double r = min(a.r, b.r);
    return PI * r * r;
  }
  long double ang1 = acos((a.r * a.r + d * d - b.r * b.r) / (2. * a.r * d)) * 2;
  long double ang2 = acos((b.r * b.r + d * d - a.r * a.r) / (2. * b.r * d)) * 2;
  double tmp1 = 0.5 * ang1 * a.r * a.r - 0.5 * a.r * a.r * sin(ang1);
  double tmp2 = 0.5 * ang2 * b.r * b.r - 0.5 * b.r * b.r * sin(ang2);
  long double ret = tmp1 + tmp2;
  return ret;
}
int main() {
  cin >> p1.x >> p1.y >> p1.r >> p2.x >> p2.y >> p2.r;
  cout << setprecision(15) << solve(p1, p2) << endl;
  return 0;
}