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++: //18
#include<iostream>
#include<cmath>
#include<iomanip>

using namespace std;

int main(){
  for(double x,h;cin>>x>>h,x!=0||h!=0;){
    cout<<fixed<<setprecision(5)<<x*x+2*x*sqrt(x*x/4+h*h)<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include<stdio.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)

using namespace std;

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

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

#define REP(n) for(int i = 0;i < n;i++)
#define LLREP(n) for(long long int  i = 0;i < n;i++)
typedef long long int ll;
using namespace std;
#define MAX_A 1000000007

int main(){

    double x,h;
    while(cin >> x >> h,x != 0){

        double bottom = x*x;
        double height = sqrt(pow(x/2,2.0)+pow(h,2.0));
        double ans = bottom + 4*x*height/2;
        printf("%.6f\n",ans);
    }

    return 0;
}

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

C++: #include <stdio.h>
#include <math.h>

int main(void)
{
	for(;;)
	{
		float a,b,c,d,e,f,ans;
		scanf("%f %f",&a,&b);
		if(a==0&&b==0)
		{
			break;
		}
		c=a/2*a/2+b*b;
		d=sqrt(c);
		ans=a*d/2*4+a*a;
		printf("%f\n",ans);
	}
	return 0;
}

C++: #include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
  double a,b;
  while(cin >>a>>b,a||b){
    double x;
    x = sqrt(b*b+a*a/4);
    printf("%.6lf\n",a*a+x*a*2);
  }
  return 0;
}

C++: #include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
	float x1,x2,x3, h ,h2, s , l;
	while(cin>>x1>>h){
		if(x1==0&&h==0)break;
		x2 = x1 / 2;
		x3=pow(x2,2);
		h2=pow(h ,2);
		x2 += h2;
		s =sqrt(x3+h2);
		
		l = (x1*s)/2;
		printf("%f\n",((4*l)+(x1)*(x1)));
	}
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <vector>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)

using namespace std;

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

C++: #define scanf_s scanf
//#define gets_s gets
#include <stdio.h>
#include <string>
#include <iostream>
#include <math.h>
using namespace std;
#define MAX 1000//0
#define _MAX 81
int main(void)
{
	double x, h, ans;
	while (1) {
		scanf_s("%lf %lf", &x, &h);
		if (x == 0 & h == 0) break;
		ans = x * x + (sqrt((x / 2) *(x / 2) + h*h) * x / 2) * 4;
		printf("%f\n", ans);
	}

}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	long long int a = 0;
	long long int b = 0;
	while (1)
	{
		cin >> a;
		cin >> b;
		if (a == 0 && b == 0)
		{
			break;
		}
		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<bits//stdc++.h>
using namespace std;
int main(){
	double a;
		double b;
	while(cin>>a>>b,a||b){
		double c=a*a;
		a/=2;
		double d=sqrt(b*b+a*a);
		c+=a*d*4;
		printf("%.10lf",c);
	}
}

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(x*x/4.0+h*h*1.0)*2;
		printf("%f\n",S);
	}
	return 0;
}

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

using namespace std;

int main(){
	double x, h, teimen, sokumen, sh, shpm, nizyo, ans;

	while(1){
		cin >> x >> h;
		if(x == 0 && h == 0){
			break;
		} 

		teimen = x * x;
		nizyo =(x / 2) * (x / 2) + (h * h);
		shpm = sqrt(nizyo);
		sh = fabs(shpm);

		sokumen = 4 * x * sh / 2;

		ans = teimen + sokumen;

		cout << ans<< fixed << setprecision(6) << endl;
	}

	return 0;
}

C++: #include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std;

/**
 * vector<int>ar(3);
 * for(auto&e:ar){
 *     scanf("%d",&e);
 * }
 * sort(ar.begin(),ar.end())
 * int sum=accumulate(ar.begin(),ar.end(),0);
 **/

int main(){
    int mod=1000000007;
    int x,h;
    for (;;) {
        scanf("%d",&x);
        scanf("%d",&h);
        if (x==h && x==0) break;
        printf("%lf\n",1.0*x*x+sqrt((1.0*x/2)*(1.0*x/2)+h*h)*x*2);
    }
    return 0;
}

C++: #include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cassert>
#include <iostream>
#include <cctype>
#include <sstream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <utility>
#include <numeric>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <complex>
#include <fstream>
#include <iomanip>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T> T RoundOff(T a){ return int(a+.5-(a<0)); }
template<class T, class C> void chmax(T& a, C b){ if(a < b) a = b; }
template<class T, class C> void chmin(T& a, C b){ if(b < a) a = b; }
template<class T, class C> pair<T, C> mp(T a, C b){ return make_pair(a, b); }

int main()
{
	double x, h;
	while(cin >> x >> h && (x || h))
		cout << setprecision(10) << x * x + x * sqrt(x * x / 4 + h * h) * 2 << endl;
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
  double x,h;
  while(cin>>x>>h){
    if(!x&&!h)break;
    printf("%.6f\n",(2*x*sqrt(x*x/4+h*h)+x*x));
  }
  return 0;
}