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;
int II;
long long I_O;
char CC, SS[20];
const int N = 1e5 + 4;
inline long long read() {
  II = 1, I_O = 0;
  while (!isdigit(CC = getchar()))
    if (CC == '-') II = -1;
  while (isdigit(CC)) I_O = I_O * 10 + CC - '0', CC = getchar();
  return I_O * II;
}
inline void wonl() { putchar('\n'); }
inline void wws() {}
inline void dbg() { cout << endl; }
inline void ww(long long k) {
  if (k < 0) putchar('-'), k *= -1;
  II = 0;
  while (k) SS[++II] = k % 10, k /= 10;
  if (!II) SS[++II] = 0;
  while (II) putchar(SS[II--] + '0');
}
template <typename T, typename... V>
inline void wonl(T t, V... v) {
  ww(t);
  if (sizeof...(v)) putchar(' ');
  wonl(v...);
}
template <typename T, typename... V>
inline void wws(T t, V... v) {
  ww(t);
  putchar(' ');
  wws(v...);
}
template <typename T, typename... V>
inline void dbg(T t, V... v) {
  cout << ' ' << t;
  dbg(v...);
}
void solve() {
  long double X, x, y, Y, R, r, ans;
  cin >> X >> Y >> R;
  cin >> x >> y >> r;
  long double n = (X - x) * (X - x) + (Y - y) * (Y - y);
  n = sqrt(n);
  long double p = acos(-1);
  if (n >= R + r)
    ans = 0;
  else if (n + r <= R || n + R <= r)
    ans = p * min(r, R) * min(r, R);
  else {
    long double a = acos((R * R + n * n - r * r) / (2 * R * n)) * 2;
    long double b = acos((r * r + n * n - R * R) / (2 * r * n)) * 2;
    ans =
        (long double)(R * R * a + r * r * b - R * R * sin(a) - r * r * sin(b)) *
        0.5;
  }
  cout << fixed << setprecision(9) << ans << endl;
}
int main() {
  solve();
  return 0;
}