while line =gets
x = line.chomp.to_f
h = gets.chomp.to_f
break if x == 0 && h == 0
sx = (x / 2) ** 2
sy = h ** 2
sh = (sx + sy) ** 0.5
area= (x ** 2) +  (x * sh *0.5) * 4
puts sprintf("%#.6f",area)
end
