#zerojudge b561 def c(n): if n ==12: return 113.097 elif n==6: return 28.274 elif n==9: return 63.617 else: return (n/2)**2*3.14159 while True: try: p=list(map(int,input().split())) k=list(map(int,input().split())) p.pop(0) k.pop(0) pt=0 kt=0 for i in p: pt+=c(i) for j in k: kt+=c(j) print("%.2f"%(abs(pt-kt))) except EOFError: break