#encoding:utf-8 No.0073 2014.10.16
while true
  x = gets.chomp.to_f
  h = gets.chomp.to_f

  if x == 0.0 && h == 0.0
    break
  end
  
  y = Math.sqrt(h**2 + (x/2)**2)  #yは側面の三角形の高さ
  s = x**2 + 2*x*y

  printf("%.6f\n",s)
end