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:167772160000")
template <typename T>
using min_heap = std::priority_queue<T, std::vector<T>, std::greater<T>>;
template <typename T>
using max_heap = std::priority_queue<T, std::vector<T>, std::less<T>>;
using namespace std;
struct Circle {
  pair<long double, long double> c;
  long double r;
};
long double dist(pair<long double, long double> a,
                 pair<long double, long double> b) {
  long double dx = a.first - b.first;
  long double dy = a.second - b.second;
  return sqrtl(dx * dx + dy * dy);
}
long double solve(Circle c1, Circle c2) {
  long double d = dist(c1.c, c2.c);
  long double r1 = min(c1.r, c2.r);
  long double r2 = max(c1.r, c2.r);
  if (d >= r1 + r2) return 0;
  if (r2 >= d + r1) return (asinl(1) * 2) * r1 * r1;
  long double t1 = acosl((r1 * r1 + d * d - r2 * r2) / (2 * r1 * d));
  long double t2 = acosl((r2 * r2 + d * d - r1 * r1) / (2 * r2 * d));
  return r1 * r1 * (t1 - sinl(t1) * cosl(t1)) +
         r2 * r2 * (t2 - sinl(t2) * cosl(t2));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  Circle c1, c2;
  cin >> c1.c.first >> c1.c.second >> c1.r;
  cin >> c2.c.first >> c2.c.second >> c2.r;
  cout << fixed << setprecision(12) << solve(c1, c2);
  return 0;
}