include Math
while 1 do
  line = gets
  a,other = line.split.map(&:to_i)
  line = gets
  b,other = line.split.map(&:to_i)
  if(a == 0 && b == 0)
    break
  end

  x = a
  h = b
  bottom_s = x * x
  slanting_s = sqrt((x / 2.0)**2 + h**2) * x / 2
  s = bottom_s + slanting_s * 4
  puts s
end