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++: // 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 <cstdio>
using namespace std;

int main()
{
  int x, h;

	while (cin >> x >> h, x, h){
		printf("%lf", x * x * h / 3);
	}
	return (0);
}

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

C++: #include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int main(){
  double x,h;
  cin >> x >> h;
  while(x != 0 && h != 0){
    double hi = sqrt((x*0.5)*(x*0.5)+h*h);
    printf("%.6lf\n",x*x + 2.0*(hi*x));
    cin >> x >> h;
  }
  return (0);
}

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

using namespace std;

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

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

C++: #include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
using namespace std;
int inf = 1000000000;


int main(void) {
  double x, h;
  while(cin >> x >> h){
    if( x == 0 ) break;
    double s = x * x;

    s += 2 * x * sqrt( h * h + x * x / 4 );

    printf("%.10lf\n", s);
  }

  return 0;
}

// EOF

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;

double calc_h (int x, int h )
{
	return sqrt((double)h*h + (double)x*x/4.);
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.SAQP", "r", stdin );
	int x, h;
	while (scanf ("%d %d", &x, &h ), x, h ){
		double th = calc_h (x, h );
//		cerr << "th: " << th << endl;
		double res = (double)x*x + 2.*(double)x*th;
		printf ("%.9lf\n", res );
	} // end loop
		
	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++: #include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
int main() 
{
	int x, h;
	double S;
	while (1) {
		cin >> x;
		cin >> h;
		if (x == 0 && h == 0) {
			break;
		}
		S = x * x + 4 * 0.5 * x * sqrt(x * 0.5 * x * 0.5 + h * h);
		cout << fixed << setprecision(6) << S << endl;
	}
	return 0;
}

C++: #include <cstdio>
#include <cmath>
int main() {
	int x, h;
	while (scanf("%d%d", &x, &h)) {
		if (x == 0 && h == 0) break;
		double temp1 = sqrt(pow((double)h, 2) + pow((double)x*sqrt(2)/2, 2));
		double temp2 = sqrt(pow(temp1, 2) - pow((double)x/2, 2));
		double S = pow((double)x, 2) + 2.0 * temp2 * (double)x;
		printf("%.6f\n", S);
	}
}

C++: #include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
#include <stack>

//AOJ0073
#define rep(x,to) for(int x=0;x<to;x++)
#define rep2(x,from,to) for(int x=from;x<to;x++)

using namespace std;

int main(void){

int x,h;
char k;
	while(cin >> x >> h){
		if(x==0 && h==0 || cin.eof()) break;
		double trg = sqrt(x*x/4.00 + 1.00*h*h) * x * 0.5;
		
		printf("%.8f\n",trg*4+x*x*1.00);
	}
	return 0;
	
}

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;
		printf("%.6lf\n", x * x + hypot(x / 2.0, h) * x * 2.0);
	}
}

C++: //1=31,2=29,3=31,4=30,5=31,6=30,7=31,8=31,9=30,10=31,11=30,12=31//
#include <iostream>
#include<string>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
    double x,s,h;
    while(cin>>x>>h){
        if(x==0&&h==0)break;
        s=x*x+4*(x*h*1/2);
        printf("%.6f?\n",s);
    }
    return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>

using namespace std;

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

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

    return 0;
}

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

double x, h;

int main() {
  while (1) {
    scanf("%lf", &x);
    scanf("%lf", &h);
    if (x == 0.0 && h == 0.0) return 0;

    printf("%f\n", x*x+x*sqrt(h*h+(x*x/4))*2);
  }
}

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

int main()
{
  int x,h;
  for(;cin>>x>>h,x;)
      cout<< fixed << setprecision(6)<<(double)x*sqrt(4*h*h+x*x)+x*x<<endl;
}