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 <cmath>
using namespace std;

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

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++: //#define _GRIBCXX_DEBUG
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iomanip>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;


// ?????¬???????????¬??????
#pragma region MACRO
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define PED cout << "\n"
#define rep(i,n) for(int i=0; i<(int)n; ++i)
#define REP(i,x,n) for(int i=x; i<(int)n; ++i)
#define repi(i,n) for(int i=0; i<=(int)n; ++i)
#define REPI(i,x,n) for(int i=x; i<=(int)n; ++i)
#define ILP while(true)
#define FOR(i,c) for(__typeof((c).begin())!=(c).begin(); i!=(c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define mp make_pair
#pragma endregion

// ???
#pragma region TYPE_DEF
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<string, string> pss;
typedef pair<string, int> psi;
typedef pair<int, string> pis;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<string> vs;
#pragma endregion

// Effective std
#pragma region ESTD
template<typename C, typename T>
constexpr int count(C& c, T t) { return count(ALL(c), t); }
template<typename C, typename F>
constexpr int count_if(C& c, F f) { return count_if(ALL(c), f); }
template<typename C, typename T>
void erase(C& c, T t) { remove(ALL(c), t), c.end(); }
template<typename C>
void remove(vector<C>& c, unsigned int index) { c.erase(c.begin()+index); }
template<typename C, typename T, typename U>
constexpr void replace(C& c, T t, U u) { replace(ALL(c), t, u); }
template<typename C, typename F, typename U>
constexpr void replace_if(C& c, F f, U u) { (ALL(c), f, u); }
template<typename C>
constexpr void reverse(C& c) { reverse(ALL(c)); }
template<typename C>
constexpr void sort(C& c) { sort(ALL(c)); }
template<typename C, typename Pred>
constexpr void sort(C& c, Pred p) { sort(ALL(c), p); }
#pragma endregion

// ?????°
#pragma region CONST_VAL
#define PI (2*acos(0.0))
#define EPS (1e-9)
#define MOD (int)(1e9+7)
#pragma endregion


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

C++: #include<cstdio>
#include<cmath>
int main(){
    double x,h;
    for(;;){
        scanf("%lf%lf",&x,&h);
        if(x==0&&h==0)break;
        printf("%lf\n",x*sqrt((x/2)*(x/2)+h*h)*2+x*x);
    }
}

C++: #include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int p, q; double s;
int main() {
	while (1) {
		cin >> p >> q;
		if (!p) { break; }
		s += p*p;
		s += 2.0*p*sqrt((p*p) / 4 + q*q);
		cout << s << endl;
	}
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <memory.h>
#include <cassert>
#include <iomanip>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;



int main() {
	for (double s, h; cin >> s >> h; ) {
		double x = sqrt(h * h + s * s / 4.0);
		cout << setprecision(10) << s * x * 2.0 + s * s << endl;
	}
	return 0;
}

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

using namespace std;

// x: base length,  h: height of pyramid
double get_surface_area_of_pyramid(int x, int h) {
	double height_of_triangle = sqrt(x * x / 4.0 + h * h);

	return 2 * x * height_of_triangle + x * x;
}

int main(void) {
	int x, h; // 4角推

	while (cin >> x >> h) {
		if (x == 0 && h == 0) {
			break;
		}
		printf("%.6f\n",get_surface_area_of_pyramid(x, h));
	}

	return 0;
}

C++: #include<iostream>
#include<cmath>
#include<stdio.h>
using namespace std;

double x, h;

double pyramid() {
	return (x * x + 4 * sqrt(h * h + x * x / 4) * x / 2);
}

int main() {
	while (true) {
		cin >> x;
		cin >> h;
		if (x == 0 && h == 0) {
			break;
		}
		printf("%.6lf\n", pyramid());
	}
}

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

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

C++: #include<iostream>
using namespace std;
int main(){
int w,h;
float ans;
while(1){
cin>>w>>h;
if(w==0&&h==0){
break;
}
ans=(float)w*w*2.0+w*h*4.0;
cout<<ans<<endl;
}
}

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

int main(){
	double x, h;

	while(1){
	cin >> x >> h;
	if(x==0 && h==0)break;
	else{
	cout << x*x*h/3 << "\n";
	}
	}
	return 0;
}

C++:     #include <stdio.h>
    #include <math.h>
     
     
    int main(void){
    	int x, h;
    	double side;
    	double bottom;
     
    	while( 1 ) {
    		scanf( "%d%d", &x, &h );
    		if( x == 0 && h == 0 ) break;
    		side = ( double ) ( x ) * sqrt( (double)( x * x / 4.0 ) + h * h ) ;
    		bottom = ( double ) ( x * x );
    		printf( "%.8lf\n", 2.0*side + bottom );
    	}
    	return 0;
    }

C++: #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = (ll)1e9;
const ll mod = (ll)1e9 + 7;

int main()
{
	double x, h;
	while (cin >> x >> h)
	{
		if (x == 0 && h == 0)
		{
			break;
		}

		double s = x * x;

		double y = sqrt((x * x / 4) + h * h);

		s += 2 * (x * y);
		cout << fixed << setprecision(6) << s << endl;
	}
}

C++: #include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define repr(i,a,n) for(int i=a;i>=n;i--)
#define INF 999999999
#define INF_M 2147483647
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
 
int main() {
    int x, h;
    while(cin >> x >> h) {
        if(x == 0 && h == 0) break;
        double ans = 0.0;
        ans += (double)x * x;
        ans += 2.0 * x * sqrt(x * x / 4.0 + h * h);
        printf("%.6f\n",ans);
    }
    return 0;
}