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<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define rp(a) while(a--)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	double a,b;
	while(cin>>a>>b,a||b){
		double t=sqrt(a*a/4+b*b);
		printf("%.9f\n",2*a*t+a*a);
	}
}

C++: #include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
double h,x;
main()
{
    while(cin>>x>>h,x)
    {
        cout<<fixed<<setprecision(9)<<x*x+2*x*hypot(x/2,h)<<endl;
    }
}

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

#define ll (long long)
#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)


using namespace std;


int main(void)
{
    double h,x;
    double answer[1000] = {0};
    int i,j,k,l = 0;
    
    while(cin >> x >> h ,x+h)
    {
        double trih = sqrt((x /2)*(x/2)+(h*h));
        //cout << trih << endl;
        double tris = ((trih)*x) /2;
        //cout << tris << endl;
        double answers = 4*tris+(x*x);
        //cout << answers << endl;
        answer[l] = answers;
        l++;
    }
    REP(i, l)
    printf("%f\n",answer[i]);
    return 0;
}

C++: #include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>

using namespace std;

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

  return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
	double a,b;
	for(;;){
		cin >>a>>b;
		if(!a && !b){break;}
		printf("%.6lf\n",a*a+2*a*sqrt((a/2)*(a/2)+b*b));
	}
}

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

int main(){
	int x, h;

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

C++: #include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <climits>
#include <cfloat>

using namespace std;

int main()
{
	while (true)
	{
		int x, h;
		scanf("%d\n%d\n", &x, &h);
		if (x == 0 && h ==0)
			break;

		printf("%.6f\n", x*x + 2*x*sqrt(x*x/4.0+h*h));
	}
	return 0;
}

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

int main(){
    int x;
    int h;
    double result;

    while(cin >> x >> h, x != 0 && x != 0){
        result = x*x + 2*x*sqrt((x/2.0)*(x/2.0)+h*h);
        printf("%.6lf\n", result);
    }
    return 0;
}

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 <cstdio>
#include <cmath>
int main()
{
	int x, h;
	while (scanf("%d%d", &x, &h), x && h)
		printf("%.6f\n", (4.0*(sqrt(double(h*h)+double(x*x)/4.0)*x))/2.0+x*x);
}

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

int main(){
	int  a,b;
	while(1){
		scanf("%d%d",&a,&b);
		if(!(a|b))return 0;
		printf("%lf\n",2*sqrt(((double)a/2)*((double)a/2)+b*b)*a+a*a);
	}
}

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


#define EPSILON 1e-9


class vector_t {
public:
  double x;
  double y;
  double z;

public:
  vector_t(double x = 0, double y = 0, double z = 0) : x(x), y(y), z(z) {};

public:
  double operator*(const vector_t& v) const {
    return x * v.x + y * v.y + z * v.z;
  };

  vector_t operator^(const vector_t& v) const {
    return vector_t(y * v.z - z * v.y,
                    z * v.x - x * v.z,
                    x * v.y - y * v.x);
  };

public:
  double length() const {
    return sqrt(*this * *this);
  };
};


class point_t {
public:
  double x;
  double y;
  double z;
  double w;

public:
  point_t(double x = 0, double y = 0, double z = 0, double w = 1) : x(x), y(y), z(z), w(w) {};
  
public:
  vector_t operator-(const point_t& p) const {
    return vector_t(x - p.x, y - p.y, z - p.z);
  };
};


int main(int argc, char** argv)
{
  int x, h;

  while (1) {
    std::cin >> x >> h;

    if (x == 0 && h == 0)
      break;

    point_t p1(x / 2.0, 0, x / 2.0), p2(x / 2.0, 0, -x / 2.0), p3(0, h);

    std::cout <<
      std::setprecision(12) << ((p2 - p1) ^ (p3 - p1)).length() * 2 + x * x << std::endl;
  }
}

C++: #include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int main(){
  double x,h;
  while(cin>>x>>h,x){
    double tri=sqrt(h*h+x*x/4.0)*x/2.0;
    printf("%.6f\n",tri*4.0+x*x);
  }
}

C++: #include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<functional>
#include<stack>
#include<list>
#include<set>
#include<deque>
#include<climits>
using namespace std;

int main(){
	double X,H;
	while(cin>>X>>H,X||H){
		printf("%lf\n",X*X+X*sqrt(X*X/4+H*H)*2);
	}
	return 0;
}

C++: #include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;

int main() {

  long long int x, h;

  while( true ) {

    cin >> x >> h;

    if ( x == 0 ) break;

    cout << fixed << setprecision(7) << sqrt( 0.25 * x * x + h * h ) * x * 2 + x * x << endl;

  }

  return 0;

}

C++: #include<cstdio>
#include<cmath>
#include<algorithm>
#include<iostream>
#include<string>
#include <vector>
#include <map>
#include<cstdlib>
#include<iomanip>

using namespace std;

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

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

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

int main()
{
	double x,h;
	while(scanf("%lf %lf",&x,&h), x||h)
	{
		printf("%.6lf\n",x*x + 2*(x*sqrt(h*h+x*x/4.0)));
	}
}

C++: #include <iostream>
#include <string>
#include <iomanip>
#include <math.h>
using namespace std;

int main()
{
	int x, h;
	double s;
	while (1)
	{
		cin >> x >> h;
		if ((x == 0) && (h == 0)) break;
		s = pow(x,2.0) + x* sqrt(pow(h,2.0)+pow(x,2.0)/4) *2;
		cout << fixed <<setprecision(6) << s << endl;
	}
	return 0;
}

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

int main(){
	double x,h;
	while(1){
	cin>>x>>h;
	if(x==0)break;
	double s=0.0;
	s+=x*x;
	s+=2*x*sqrt(x*x/4+h*h);
	printf("%0.8lf\n",s);
	}

	return 0;
}

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

int main(void)
{
  while (true)
  {
    double x, h;
    cin >> x >> h;
    if (x == 0 and h == 0) break;
    double t_h = hypot(x/2, h);
    double result = x * t_h * 2 + pow(x, 2);
    printf("%.6lf\n", result);
  }
  return 0;
}