import math r = float(input()) R = float(imput()) a = math.asin(r/R) print(2*math.pi-2*a) print((R*R+2*R*r-r*r)*(math.pi-a)+math.pi*r*r)