def General_Binary_Decrease_Search(L,R,cond,Integer=True,ep=1/(1<<20),Times=50): """条件式が単調減少であるとき,一般的な二部探索を行う. L:解の下限 R:解の上限 cond:条件(1変数関数,広義単調減少 or 広義単調減少を満たす) Integer:解を整数に制限するか? ep:Integer=Falseのとき,解の許容する誤差 """ if not(cond(L)): return None if cond(R): return R if Integer: L-=1 while R-L>1: C=L+(R-L)//2 if cond(C): L=C else: R=C return L else: while (R-L)>=ep and Times: Times-=1 C=L+(R-L)/2 if cond(C): L=C else: R=C return L #================================================ def check(t): x=R-R*cos(t) y=0-R*sin(t) return x*x+y*y>=(2*r)**2 #================================================ from math import pi,sin,cos r=float(input()) R=float(input()) T=General_Binary_Decrease_Search(pi,2*pi,check,False,pow(10,-7),1000) print(T) S=r*r*pi+((R+r)**2-(R-r)**2)*T/2 print(S)