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;
inline long double min(long double a, long double b) {
  if (a < b) return a;
  return b;
}
inline long double max(long double a, long double b) {
  if (a < b) return b;
  return a;
}
long double x, y, z, a, b, c;
long double dist(long double px1, long double py1, long double px2,
                 long double py2) {
  long double res = 0;
  res += (px1 - px2) * (px1 - px2);
  res += (py1 - py2) * (py1 - py2);
  return sqrt(res);
}
long double solve2() {
  long double dis = dist(x, y, a, b);
  long double low = 0;
  long double high = min(z, c);
  for (int i = 0; i < 200; i++) {
    long double m = (low + high) / 2;
    long double temp1 = sqrt(z * z - m * m);
    long double temp2 = sqrt(c * c - m * m);
    if (abs(temp1 - temp2) == dis) {
      low = m;
      break;
    } else if (abs(temp1 - temp2) < dis)
      low = m;
    else
      high = m;
  }
  if (z > c) swap(z, c);
  long double ang1 = 2 * 3.141592653589793 - 2 * asin(low / z);
  long double ang2 = 2 * asin(low / c);
  long double res = ang1 * z * z / 2 + ang2 * c * c / 2;
  res += sqrt(z * z - low * low) * low;
  res -= sqrt(c * c - low * low) * low;
  return res;
}
bool cond(long double aa, long double bb, long double cc) {
  if (aa > bb) swap(aa, bb);
  if (bb * bb > aa * aa + cc * cc) return true;
  return false;
}
long double solve() {
  long double dis = dist(x, y, a, b);
  if (dis >= z + c) return 0;
  if (cond(z, c, dis)) return solve2();
  long double low = 0;
  long double high = min(z, c);
  for (int i = 0; i < 200; i++) {
    long double m = (low + high) / 2;
    long double temp = sqrt(z * z - m * m);
    temp += sqrt(c * c - m * m);
    if (temp == dis) {
      low = m;
      break;
    } else if (temp < dis)
      high = m;
    else
      low = m;
  }
  long double ang1 = 2 * asin(low / z);
  long double ang2 = 2 * asin(low / c);
  long double res = ang1 * z * z / 2 + ang2 * c * c / 2;
  res -= sqrt(z * z - low * low) * low;
  res -= sqrt(c * c - low * low) * low;
  return res;
}
int main() {
  cin >> x >> y >> z;
  cin >> a >> b >> c;
  cout << setprecision(15);
  cout << solve() << endl;
  return 0;
}