Go: package main

import (
	"fmt"
	"math"
)

func main() {
	x := -1
	h := -1
	for {
		fmt.Scan(&x)
		fmt.Scan(&h)
		if x == 0 && h == 0 {
			return
		}

		f_x := float64(x) / 2.0

		sya := math.Sqrt(f_x*f_x + float64(h*h))
		fmt.Println(float64(x*x) + float64(x)*sya*2.0)

	}
}

Python: import math
x = int(input())
h = int(input())
if x == h == 0:
    break
    S = (x ** 2) + 4(x * (math.sqrt((1 / 2) * x ** 2 + h ** 2 ))) 
    print(S)

Python: for x in iter(input,'0'):
 x=int(x)
 print(x*x+2*x*((x/2)**2+int(input())**2)**.5)

Python: import math
while 1:
  x=float(input())
  h=float(input())
  if not x and not h:break
  S=x**2+2*math.sqrt((h**2)*(x**2)+1/4*(x**4))
  print("{0:6f}".format(S))

Python: while True:
    x = float(input())
    h = float(input())
    if x == 0 and h == 0: break
    print("%.6f"%(x**2+x*2*(h**2+(x/2)**2)**0.5))

Python: from math import sqrt
while True:
    x, h = int(input()), int(input())
    if x==h==0: break
    sh = sqrt((x/2)**2 + h**2)
    print((x*x) + sum([sh*x*0.5 for _ in range(4)]))

Python: while 1:
 x,h=int(input()),int(input())
 if x==0:break
 print(x*x+((x/2)**2+h**2)**.5*x*2)

Python: while 1:
    try:
        x=int(input())
        h=int(input())
        if x==0 and h==0 :break
        print("{:.6f}".format(x**2+(((((x/2)**2)+h**2)**0.5)*x)*2))
    except:break

Python: while 1:
 x,h=int(input()),int(input())
 if x:print(x*x+((x/2)**2+h**2)**.5*x*2)

Python: while True:
    x = float(input())
    h = float(input())
    if x + h == 0: break
    S = 0
    a = ((x / 2) ** 2 + h ** 2) ** 0.5
    S += x * x
    S += (a * x * 0.5) * 4
    print(S)

Python: while(1):
    x,h = [int(input()) for i in range(2)]
    if x == 0 and h == 0:
        break
    x,h = [float(i) for i in [x,h]]
    tot = x**2 + 4*0.5*x*(h**2 + (x/2)**2)**(0.5)
    print("{:.6f}".format(tot))

Python: from math import sqrt
while 1:
    x = int(input())
    h = int(input())
    if x == 0 and h == 0: break
    print("{0:.8f}".format(x*x + 2.0 * x * sqrt(h*h + 1/4.0*x*x)))

Python: while True:
	x, h = map(int, [input(), input()])
	if x == 0 and h == 0:
		break
	print(4 * (h*h+(x/2)*(x/2))**0.5 * x / 2 + x*x)

Python: import math

while True:
    x = int(input())
    h = int(input())
    if x == 0 and h == 0:
        break


    S = 1/2 * x * 4*(1/4 * x**2 + h**2)**0.5 + x**2
    print(S)

Python: import math

while True:
    x = float(input())
    if x == 0:
        break
    h = float(input())
    l = math.sqrt(0.25*x**2 + h**2)
    print(x**2 + 2*x*l)

Python: import math
x = int(input())
h = int(input())
if x == h == 0:
    break
    S = (x ** 2) + 4(x * (math.sqrt(((1 / 2) * x) ** 2 + h ** 2 ))) 
    print(S)

Python: from math import hypot

while True:
    x, h = int(input()), int(input())
    if x == h == 0:
        break
    print(hypot(x/2, h)*x*2+x*x)

Python: while True:
    x=int(input())
    h=int(input())
    if x==0 and h==0:
        break
    a=x**2+x*(4*h**2+x**2)**(1/2)
    print(a)

Python: import math
while True :
    x = float(input())
    h = float(input())
    if x == 0 and h == 0 :
        break
    
    ans = x**2 + math.sqrt(x**2 + 4 * (h**2)) * x
    print('{:.6f}'.format(ans))

Python: import sys
import math
def main():
    for line in sys.stdin:
        x = int(line)
        h = int(input())

        if x != 0 and h != 0:
            s1 = x * math.sqrt(4 * (h ** 2) + x ** 2)
            s2 = s1 + x ** 2
            print("{:.6f}".format(s2))
        else:
            break

if __name__ == "__main__":
    main()

Python: while True:
	x=int(input())
	h=int(input())
	if x==h==0:
		break
	S=x**2+2*x*(h**2+(x**2)/4)**(1/2)
	print(S)

Python: import math
while True:
    x = int(input())
    h = int(input())
    if x == 0 and h == 0: break
    
    h2 = math.sqrt((x/2)*(x/2) + h*h)
    print(float(x*x + 2*x*h2))

Python: import math

while True:
    x = int(input())
    h = int(input())
    if x == 0 and h == 0:
        break

    x = float(x)
    h = float(h)
    y = math.sqrt(h**2 + x**2/4.0)
    print(x**2 + 2.0*x*y)

Python: while True:
  x = int(input())
  h = int(input())
  if x == h == 0:
    break
  else:
    t = (h**2+(x/2)**2)**(1/2)
    print(x*x+x*t*2)

Python: import math
while True:    
    x = float(input())
    h = float(input())
    if x==h==0: break

    f = math.hypot(1/2*x,h)
    S = x**2 + 4*f*x/2
    print(S)

Python: import sys
readline = sys.stdin.readline
write = sys.stdout.write
def solve():
    x = int(readline())
    h = int(readline())
    if x == h == 0:
        return False
    write("%.16f\n" % (x*x + x*(x*x + 4*h*h)**.5))
    return True
while solve():
    ...

Python: import math
while True:
  a=int(input())
  b=int(input())
  if a==0:
    break
  s=a*a+2*a*(math.sqrt(b*b+(a/2)*(a/2)))
  print(s)

Python: while True:
  x, h = int(input()), int(input())
  if x == 0:
    break
  print(x ** 2 + x * (4 * h ** 2 + x ** 2) ** (1 / 2))

Python: # Aizu Problem 0073: Surface Area of Quadrangular Pyramid
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


while True:
    x = int(input())
    h = int(input())
    if x == h == 0:
        break
    h_x = math.sqrt(h**2 + x**2 / 4)
    A = x**2 + 2 * x * h_x
    print("%.6f" % A)

Python: while 1:
    x=float(input())
    h=float(input())
    if x==0: break
    print(x*x+2*x*(((x/2)**2)+h*h)**0.5)

Python: import math
while True:
    X = float(input())
    H = float(input())
    if X == 0.0:
        break
    ans = 0.0
    ans += X * X
    ans += math.sqrt(H * H + X * X / 4.0) * X * 2
    print(ans)

Python: import sys
f = sys.stdin


while True:
    x, h = (int(f.readline()) for i in range(2))
    if x == h == 0:
        break
    triangle_height = (h ** 2 + (x / 2) ** 2) ** 0.5
    s = x ** 2 + 4 * x * triangle_height / 2
    print('{:.6f}'.format(s))

Python: import math
while 1:
    x = int(input())
    h = int(input())
    if x == h == 0:
        break

    b = math.sqrt(h * h + x * x / 4) * x / 2
    print(4 * b + x * x)

Python: def piramid(x,h):
    import math
    a = math.sqrt((x/2)**2 + h**2)
    b = (x*a)/2
    c = x**2 + 4*b
    return print(c)

Python: from math import sqrt

while True:
    x = float(input())
    h = float(input())
    if x == h == 0: break
    ans = (sqrt(4*h*h + x**2) + x) * x
    print(ans)

Python: import math
while True:
    x = int(input().strip())
    h = int(input().strip())
    if x==0 and h==0:
        break
    d = math.sqrt((x/2.0)**2 + h**2)
    s = x * d / 2.0 * 4 + x**2
    print(s)

Python: while True:
  x = int(input())
  h = int(input())
  if x == 0 and h == 0:break
  s = x ** 2 + x * (4 * h ** 2 + x ** 2) ** (1 / 2)
  print(s)

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0073

"""
import sys
from sys import stdin
input = stdin.readline


def solve(x, h):
    ans = x * x                 #  ?????¨?????¢???

    diagonal = (x**2 + x**2)**0.5 / 2   #  ?????????????????¢????????´????????????????????????????§??????§????????¢
    oblique = (diagonal**2 + h**2)**0.5 #  ????§???¢?????????
    # ??????????????¬???
    s = (x + oblique + oblique) / 2
    triangle = (s * (s - x) * (s - oblique) * (s - oblique))**0.5 #  ????§???¢ 1????????¢???
    
    triangle *= 4               #  ????§??????????????§???¢???4??¢???????????§?????¨??¨?????¢???????¨????
    ans += triangle
    return ans


def main(args):
    while True:
        x = int(input())
        h = int(input())
        if x == 0 and h == 0:
            break
        result = solve(x, h)
        print('{:.6f}'.format(result))


if __name__ == '__main__':
    main(sys.argv[1:])

Python: # AOJ 0073: Surface Area of Quadrangular Pyramid
# Python3 2018.6.15 bal4u

import math
while True:
	x = int(input())
	if x < 1: break
	h = int(input())
	s = math.sqrt(4*h*h + x*x) + x;
	print(s*x);