from math import * r = float(input()) R = float(input()) rad = asin(r/R) print(2*(pi-rad)) s = R*r*pi*8*(pi-rad)/(2*pi)+r**2*pi print(s)