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