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 PYTHON):

Solution:
import math
from decimal import *


def sqrt(v):
    a = Decimal(0)
    b = v
    while a != b:
        a = b
        b = (a+v/a)/TWO
    return a


def taylor_acos(v):
    return PI/2 - taylor_asin(v)


def taylor_asin(v):
    curr = v
    vsq = v**2
    ans = v
    coef = Decimal(1.)
    for i in xrange(3, 101, 2):
        curr *= vsq
        coef = coef * (i-2) / (i-1)
        ans += curr * coef / i
    return ans


def acos(v):
    if v <= S:
        return Decimal(taylor_acos(v))
    return Decimal(taylor_asin(sqrt(1-v**2)))


def sector(a, b, c, csq):
    d = Decimal(b**2+csq-a**2)
    e = TWO*Decimal(b)*c
    f = acos(d/e)
    return f*(Decimal(b)**2)

getcontext().prec = 500
PI = Decimal(math.pi)
TWO = Decimal(2)
S = 1/sqrt(Decimal(2))
x1, y1, r1 = map(int, raw_input().split())
x2, y2, r2 = map(int, raw_input().split())
asq, bsq, csq = r1**2, r2**2, (x1-x2)**2+(y1-y2)**2
a, b, c = r1, r2, sqrt(Decimal(csq))
if asq + 2*a*b + bsq <= csq:  # a+b<=c
    print 0
elif csq <= asq - 2*a*b + bsq:   # a+c<=b or b+c<=a, that is c<=abs(a-b)
    print PI*min(a, b)**2
else:
    area = sqrt(Decimal(2*(asq*bsq+asq*csq+bsq*csq)-asq**2-bsq**2-csq**2))/TWO
    first_sector = sector(a, b, c, csq)
    second_sector = sector(b, a, c, csq)
    print first_sector+second_sector-sqrt(Decimal(2*(asq*bsq+asq*csq+bsq*csq)-asq**2-bsq**2-csq**2))/TWO