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 <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
using namespace std;
int size(string x){
	string::size_type size=x.size();
	return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define fi first
#define se second
typedef  vector<string> vs;
typedef  vector<int> vi;
double pi(){
	return M_PI;
}
typedef set<int> set_i;
typedef set<string> set_s;
int INF=1000000;
int main(){
	int x,h;
	double ssr,sr;
	while(1){
		cin>>x;
		cin>>h;
		if(x==0&&h==0) break;
		sr=sqrt(h*h+x*x/4);
		ssr=2*x*sr+x*x;
		printf("%.8lf\n", ssr);
	}
}

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
#include<list>

using namespace std;

typedef  long long int lint;

#define rep(i, n) for (lint i = 0; i < n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define mp make_pair
#define IP pair<int,int>
#define enld endl

int main() {
	double x, h;
	while (cin >> x >> h, !(x == 0 && h == 0)) {
		double a = sqrt(h * h + x * x / 2);
		double b = sqrt(a * a - x * x / 4);
		cout << fixed << setprecision(20) << x * x + 2 * x * b << endl;
	}
}

C++: #include <bits/stdc++.h>
#define r(i,a,n) for(int i=a;i<n;i++)
using namespace std;
int main(){
	double a,b;
	while(cin>>a>>b,a){
		cout<<(a*a)+2*a*sqrt(((a/2)*(a/2)+b*b))<<endl;
	}
}

C++: 6
4
7
9
0
0

C++: #include<cstdio>
#include<cmath>
using namespace std;
int main(void)
{
	double x,h,y,s;
	while(1)	{
		scanf("%lf %lf",&x,&h);
		if(x==0.0 && h==0.0)	break;
		y=sqrt((x/2.0)*(x/2.0)+h*h);
		s=x*x+4.0*(x*y/2.0);
		printf("%lf\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 <cstdio>
using namespace std;

int main()
{
  int x, h;

	while (cin >> x >> h, x, h){
		printf("%l.6f", x * x * h / 3);
	}
	return (0);
}

C++: #include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v;}
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str();}
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-12;
const double PI = acos(-1.0);
const int INF = INT_MAX/10;

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

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

using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  double x,h;
  while(1){
    scanf("%lf %lf",&x,&h);
    if(x==0 && h==0) break;
    double soku = sqrt(((double)x*0.5) * ((double)x*0.5)+ (double)h*(double)h);
    printf("%f\n",(double)x*(double)x + (double)4 * (soku * (double)x * 0.5));
  }
}

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

int main() {
  int x, h;
  while(scanf("%d%d", &x, &h) && (x | h)) {
    double m = sqrt(h*h + x*x/2.0);
    double s = (m*2+x)/2.0;
    double S = sqrt(s*(s-m)*(s-m)*(s-x));
    printf("%.10f\n", 4*S + x*x);
  }
}

C++: #include<bits/stdc++.h>
using namespace std;

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

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

using namespace std;

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

        auto const v = x * sqrt( 4 * h * h + x * x ) + x * x;
        cout << setprecision( 6 ) << fixed << v << endl;
    }
}

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

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

int main(void){
	int x, h;
	double ans;

	while(1){
		scanf("%d %d", &x, &h);
		if(x == 0 && h == 0) break;

		ans = x*x + 4*(sqrt((x/2.0)*(x/2.0) + h*h) * x / 2.0);
		printf("%6f\n", ans);
	}


	return 0;
}

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

using namespace std;

int main(){
  double x, h, s;

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

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

    cout.setf(ios::fixed, ios::floatfield);
    cout.precision(6);
    cout << s << endl;
  }

  return 0;
}

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

int main(){
  double S,x,h;

  for(;;){
    cin >> x >> h;
    if(x == 0 && h == 0) break;

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

  return 0;
}