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 sys
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

TWO = Decimal(2)
S = 1/sqrt(Decimal(2))
getcontext().prec = 50
PI = Decimal(math.pi)

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


class Point(object):
    def __init__(self, x, y):
        self.x = x
        self.y = y

def point_dis(p1, p2):
    return sqrt((p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2)

def get_area(l1, l2, l3):
    s = (l1 + l2 + l3) / Decimal(2.0)
    return sqrt(s * (s - l1) * (s - l2) * (s - l3))


(x1, y1, r1) = map(int, raw_input().split())
(x2, y2, r2) = map(int, raw_input().split())

c1 = Point(x1, y1)
c2 = Point(x2, y2)

dis = point_dis(c1, c2)

if dis >= r1 + r2:
    print 0.0
    sys.exit(0)
if dis == 0:
    print PI * (min(r1, r2) ** 2)
    sys.exit(0)

if min(r1, r2) + dis <= max(r1, r2):
    print PI * (min(r1, r2) ** 2)
    sys.exit(0)

r1, r2, dis = map(Decimal, [r1, r2, dis])

a1 = acos((r1 * r1 + dis * dis - r2 * r2) / (2 * r1 * dis)) * 2
a2 = acos((r2 * r2 + dis * dis - r1 * r1) / (2 * r2 * dis)) * 2

s1 = PI * r1 * r1 * (2 * PI - a1) / (2 * PI)
s2 = PI * r2 * r2 * (2 * PI - a2) / (2 * PI)

s3 = 2 * get_area(r1, r2, dis)

#print PI * r1 * r1 + PI * r2 * r2, s1, s2, s3
print PI * r1 * r1 + PI * r2 * r2 - s1 - s2 - s3