import math r =float(input()) R =float(input()) #余弦定理でcosを求める c = (R*R+R*R-4*r*r)/(2*R*R) #時間t'を求める t = 2*math.pi-math.acos(c) #弧度法に直す theta = t*180/math.pi #半径R+rの円とR-rの円の差分を求め、角度から比率を計算し面積を求める。 area = math.pi*((R+r)*(R+r)-(R-r)*(R-r))*theta/360. #また半径rの円の面積も足す。 area += math.pi*r*r print(t) print(area)