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)

	}
}

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

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

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

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

int main()
{
  int x, h;
  while (cin >> x >> h && !(x == 0 && h == 0)) {
    const double l = hypot(h, x/2.0);
    const double s = 2*x*l + x*x;
    printf("%.6f\n", s);
  }
  return 0;
}

C++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  double x, h;
  while (cin >> x >> h, x) {
    cout << prec(8) << x * x + x * hypot(h, x / 2) * 2 << endl;
  }
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	long long int a = 0;
	long long int b = 0;
	while (cin >> a, cin >> b)
	{
		long long int c = a*a*(a*a + 4 * b*b) * 10000000000;
		long long int d = sqrt(c);
		cout << a * a + d / 100000 << '.' << d % 100000 << endl;
	}
	
	return 0;
}

C++: #include <cmath>
#include <iostream>
int main(){
	int x,h;
	while(std::cin>>x>>h,x!=0||h!=0)std::printf("%.6f\n",x*x+2*x*sqrt(x*x*.25+h*h));
}

C++: #include <iostream>
#include <cstdio>
#include <vector>
#include <list>
#include <algorithm>
#include <cmath>
#include <stack>
#include <map>
#include <numeric>
#include <sstream>
#include <queue>
using namespace std;

#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
#define FOR(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define PUSH(n,v) for(int i=0; i<(n); i++) {int j; cin >> j; v.push_back(j);}
#define ALL(v) v.begin(), v.end()
#define print(s) cout << (s) << endl

void solve73(int x, int h) {
    double hypo = sqrt(h*h + x*x/4.0);
    printf("%.6f\n", hypo*x*2 + x*x);
}

int main() {
    int x,h;
    while(cin >> x >> h, x + h) {
        solve73(x,h);
    }
    return 0;
}

C++: #include <stdio.h>
#include <math.h>
int main()
{
	int x,h;
	float S;
	while(1){
		scanf("%d %d",&x,&h);
		if(x==0&&h==0)
			break;
		S=x*x;
		S+=x*sqrt(0.5*x*0.5*x+h*h)*2;
		printf("%f\n",S);
	}
	return 0;
}

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

int main(){
	int x, h;
	double s, a;
	while(true){
		cin>>x>>h;
		if(x==0 && h==0)break;
		a = (x*x)/(double)4 + h*h; 
		a= sqrt(a);
		s = a*x*2;
		s += x*x;
		printf("%.6f\n", s);
	}
	return 0;
}

C++: #define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <bitset>
#include <complex>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define dump(x)  cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i:a)cout << i << " "; puts("");

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef complex<double> CD;

int main() {
	while (true) {
		double x, h; cin >> x >> h;
		if (x == 0 && h == 0)break;
		double h2 = sqrt((x / 2)*(x / 2) + h * h);
		double ans = x * x + x * h2 * 2;
		printf("%.20f\n", ans);
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  double x,h;
  while(cin >> x >> h){
    if(x+h==0){
      return 0;
    }
    printf("%.10lf\n",x*x+2*(sqrt((x/2)*(x/2)+h*h)*x));
  }
}

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

int main() {
    cout << fixed << setprecision(6);

    long double x, h;
    while (true) {
        cin >> x >> h;
        if (x == 0 && h == 0) break;
        cout << x * x + 2 * x * sqrt(h * h + x * x / 4) << endl;
    }
}

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

int main(){
    int x, h;
    while(cin >>x >>h){
        if(x == 0 && h == 0) break;
        double ans = x * x, tmp = x * (sqrt(((x / 2.0) * (x / 2.0)) + (h * h))) / 2;
        ans += (tmp * 4);
        printf("%f\n", ans);
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <sstream>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <set>
#include <complex>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59

int main()
{
    //std::ios::sync_with_stdio(false);
    //std::cin.tie(0);
    cout << fixed << setprecision(7);

    int x, h;
    while (cin >> x >> h)
    {
        if (x == 0 && h == 0)
            break;
        long double t = (double)x * x / 2.0 + (double)h * h - (double)x * x / 4.0;

        double lb = 0.0, ub = 100000.0;
        for (int i = 0; i < 100; ++i)
        {
            double mid = (lb + ub) / 2;
            if (t > mid * mid)
            {
                lb = mid;
            }
            else if (t < mid * mid)
            {
                ub = mid;
            }
            else
            {
                lb = mid;
                break;
            }
        }
        cout << (double)2.0 * x * (double)lb + x * x
             << endl;
    }
    return 0;
}

C++: /*
	0073:Surface Area of Quadrangular Pyramid
*/
#include	<iostream>
#include	<cstdio>
#include	<cmath>

using namespace std;

int main(void) {
	while(1) {
		int x, h;
		cin >> x >> h;
		
		if(x == 0 && h == 0) { break; }
		
		printf("%.6f\n", x * sqrt(4 * h * h + x * x) + x * x );
	}
}