Problem: Write a program which prints the area of intersection between given circles $c1$ and $c2$.

Constraints

* $-10,000 \leq c1x, c1y, c2x, c2y \leq 10,000$
* $1 \leq c1r, c2r \leq 10,000$

Input

The input is given in the following format.

$c1x\; c1y\; c1r$
$c2x\; c2y\; c2r$


$c1x$, $c1y$ and $c1r$ represent the coordinate and radius of the first circle. $c2x$, $c2y$ and $c2r$ represent the coordinate and radius of the second circle. All input values are given in integers.

Output

Output the area in a line. The output values should be in a decimal fraction with an error less than 0.000001.

Examples

Input

0 0 1
2 0 2


Output

1.40306643968573875104


Input

1 0 1
0 0 3


Output

3.14159265358979311600

Solution (in CPP):

Solution:
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>
#include <algorithm>

using namespace std;
#define dTolerance 1.0e-10

int main(){
    long double x1,x2,y1,y2,r1,r2;
    scanf("%Lf %Lf %Lf", &x1, &y1, &r1);
    scanf("%Lf %Lf %Lf", &x2, &y2, &r2);
    
    long double dDist = sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2));
    long double dSquare;
    if(fabs (r1 - r2) > dDist - dTolerance){
        dSquare = min(r1, r2) * min(r1, r2) * M_PI;
    } else if(r1 + r2 < dDist - dTolerance) {
        dSquare = 0;
    } else {
        long double dTheta1, dTheta2;
        dTheta1 = acos( (dDist * dDist + r1 * r1 - r2 * r2) / (2 * dDist * r1));
        dTheta2 = acos( (dDist * dDist - r1 * r1 + r2 * r2) / (2 * dDist * r2));
        dSquare = r1 * r1 * dTheta1 + r2 * r2 * dTheta2 - sqrt( (2 * r1 * r1 + 2 * r2 * r2 - dDist * dDist) * dDist * dDist - (r1 * r1 - r2 * r2) * (r1 * r1 - r2 * r2) ) / 2;
    }
     printf("%.20Lf", dSquare);
     return 0;
    
}