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: #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import (division, absolute_import, print_function,
                        unicode_literals)
from sys import stdin
from math import hypot

while True:
    x = int(stdin.readline())
    h = int(stdin.readline())
    if not (x or h):
        break
    print('{:.6f}'.format(x * x + hypot(x, h * 2) * x))

Python: import math
while True:
    x = int(input())
    h = int(input())
    if x == 0 and h == 0:
        break
    tei = x * x
    tor = x * (math.sqrt(h * h + (x / 2) ** 2) * 1 / 2)
    ans = tei + 4 * tor
    print("{0:.6f}".format(ans))

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

Python: while 1:
    try:
        x=int(input())
        h=int(input())
        if x==h==0:break
        ans=x**2
        he=(h**2+x**2/4)**0.5
        tri=he*x*0.5
        ans+=tri*4
        print(f"{ans:.7f}")
    except:break

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

Python: import math
if __name__ == '__main__':

	while True:
		try:
			x = int(input())
			h = int(input())

			if x == 0 and h == 0:
				break

			n = math.sqrt(h ** 2 + (x / 2) ** 2) 
			ans = (x ** 2) + (x * n * 0.5) * 4
			print('{:.5f}'.format(ans))

		except EOFError:
			break

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: import math

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

    a = math.sqrt((x/2)**2 + h**2)

    s = a * x * 2 + x**2
    print(s)

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

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

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 = int(input())
    h = int(input())
    if x == h == 0:
        break
    S = (x ** 2) + 4(x * (math.sqrt((1 / 2) ** 2 + h ** 2 ))) 

print(S)

Python: import math

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

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

    print(S)

Python: # -*- coding: utf-8 -*-

import sys
import os
import math

for s in sys.stdin:
    x = int(s)
    h = int(input())
    if x == h == 0:
        break

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

Python: import math

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

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<string.h>
#include<vector>
#include<math.h>
#include<queue>
#include <algorithm>
#include<functional>
#include<cstdlib>
#include<cmath>


#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define CI cin >>
#define CO cout <<
#define E << endl;

using namespace std;

typedef pair<int, int> P;
typedef pair<long, long> LP;
typedef pair<int, P> PP;
typedef pair<long, LP> LPP;



int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };


double X = 0;
double H = 0;

void input(void) {
	CI X;
	CI H;

	return;
}


int main(void) {
	while (1) {
		input();
		if (X == 0 && H == 0) {
			return 0;
		}
		printf("%.7f", (X * X) + (2 * X * sqrt((H * H) + (X * X) / 4.0)));
	}

	return 0;
}

C++: #include <iostream>
#include <cmath>

using namespace std;

void solve()
{
	double x, h;
	while(cin >> x >> h, x || h)
	{
		double Sum = x * x;
		double Height = sqrt(h * h + (x / 2) * (x / 2));
		Sum += Height * x * 2;
		printf("%.6f\n", Sum);
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main()
{
    long double x, h;
    while(cin >> x >> h, x || h){
        cout << fixed << x * x + sqrt((x / 2) * (x / 2) + h * h) * x * 2 << endl;
    }
}

C++: #define _USE_MATH_DEFINES
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>

using namespace std;

int main(){
	double x,h;
	while(cin>>x>>h,(x||h)) printf("%lf\n",x*x + 2 * x * sqrt(h*h+x*x/4));
	
    return 0;
}

C++: #include<iostream>
#include<string>
#include<math.h>
#include<iomanip>
using namespace std;
int main(){
	int x,h;
	while(true){
		cin>>x>>h;
		if(x==0&&h==0)
			break;
		double s=x*x;
		s+=x*2*(double)sqrt((double)x*x/4+h*h);
		cout<<fixed<<setprecision(10)<<s<<endl;
	}
    return 0;
}

C++: #include <cstdio>
#include <iostream>
#include <cmath>
using namespace std;

double solve(int x, int h){
    double h2 = sqrt((x/2.0)*(x/2.0) + h*h);
    return x*x + (x * h2 / 2) * 4;
}

int main(){
    int x, h;
    while(cin >> x >> h){
        if(x == 0 && h == 0) break;
        printf("%f\n", solve(x, h));
    }
    return 0;
}

C++: #define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<list>
#include<stack>
#include<queue>
#include<cctype>
#include<iomanip>
#include<functional>
#include<numeric>
#include<map>
#include<set>
#define EPS 1e-10
using namespace std;
typedef long long llong;
int main() {
	double x, h;
	cout << setprecision(11);
	while (cin >> x >> h&&x&&h) {
		double a = x*pow(2, 0.5) / 2;
		double b = pow(a*a + h*h, 0.5);
		double c = x / 2;
		double d = pow(b*b - c*c, 0.5);
		cout << x*x + x*d / 2 * 4 << endl;
	}
	return 0;
}

C++: #include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

#define dump(a) (cerr << (#a) << " = " << (a) << endl)
#define FOR(it,c) for(__typeof((c).begin())it=(c).begin(); it!=(c).end();++it)
#define RFOR(it,c) for(__typeof((c).rbegin())it=(c).rbegin(); it!=(c).rend();++it)
#define exist(c, v) (find((c).begin(), (c).end(), (v)) != (c).end())

template<class T> inline void chmax(T& a, const T& b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, const T& b) { if(b < a) a = b; }

template<typename T, typename U> ostream& operator<<(ostream& os, const pair<T, U>& p) {
	os << '(' << p.first << ", " << p.second << ')';
	return os;
}

template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	copy(v.begin(), v.end(), ostream_iterator<T>(os, " "));
	return os;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	for(int x, h; scanf("%d %d", &x, &h), x | h;) {
		const double o = hypot(x / 2.0, h);
		const double s = o * x * 2.0 + x * x;
		printf("%.10lf\n", hypot(x / 2.0, h) * x * 2.0 + x * x);
	}

	return EXIT_SUCCESS;
}