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 = acosl(-1);
int n;
pair<long double, pair<long double, long double> > a, b;
void home() {}
void enter() {
  long long x, y, z;
  cin >> x >> y >> z;
  a = {x, {y, z}};
  cin >> x >> y >> z;
  b = {x, {y, z}};
  if (a.second.second > b.second.second) swap(a, b);
}
long double sq(long double num) { return num * num; }
long double tinh(long double b, long double c, long double a) {
  long double co = (b * b + c - a * a) / (2 * b * sqrt(c));
  long double goc = acosl(co);
  long double si = sinl(2 * goc);
  return sq(b) * (goc - si / 2);
}
void solve() {
  long double tam = sq(a.first - b.first) + sq(a.second.first - b.second.first);
  if (tam >= sq(a.second.second + b.second.second)) {
    cout << 0;
    return;
  }
  if (tam <= sq(b.second.second - a.second.second)) {
    cout << setprecision(8) << sq(a.second.second) * pi;
    return;
  }
  long double p1 = tinh(a.second.second, tam, b.second.second);
  long double p2 = tinh(b.second.second, tam, a.second.second);
  cout << setprecision(10) << (p1 + p2);
}
int main() {
  cout << fixed;
  home();
  enter();
  solve();
}