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 <vector>
#include <cstdio>
#include <string>
#include <cmath>
using namespace std;
int main(){
	
	int x,h;
	double t,s;
	while(cin>>x>>h){
		if(x==h!=0){
			t=sqrt(pow((double)x/2,2)+pow(h,2));
			s=pow(x,2)+(double)(x*t)*2;
		
		printf("%.6f\n",s);
		}
		else
			break;
	}
	
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
#define rer(i,l,n) for(int i=l;i<=n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pii;

int main(){
	double x,h,s;
	while(1){
		cin>>x>>h;
		if(x==0&&h==0) break;
		s=pow(x,2)+2*x*pow(x*x/4+h*h,0.5);
		printf("%.8lf\n",s);
	}

}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<string.h>
#include<vector>
#include<math.h>
#include<queue>
#include <algorithm>
#include<functional>
#include<cstdlib>
#include<cmath>


#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define CI cin >>
#define CO cout <<
#define E << endl;

using namespace std;

typedef pair<int, int> P;
typedef pair<long, long> LP;
typedef pair<int, P> PP;
typedef pair<long, LP> LPP;



int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };


double X = 0;
double H = 0;

void input(void) {
	CI X;
	CI H;

	return;
}


int main(void) {
	while (1) {
		input();
		if (X == 0 && H == 0) {
			return 0;
		}
		printf("%.6f", X * X + 2 * X * sqrt(H * H + X * X / 4.0));
	}

	return 0;
}

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

/** Problem0073 : Surface Area of Quadrangular Pyramid **/
int main()
{
	double x, h, S;
	
	while (cin >> x >> h) {
		if (x == 0 && h == 0) break;
		S = x*x + x*sqrt(x*x+4*h*h);
		printf("%.6lf\n", S);
	}
}

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

int main() {
    int x, h;
    while (cin >> x >> h, (x || h)) {
        double area = x * x + 2.0 * x * sqrt(h * h + x * x / 4.0);
        cout.precision(6);
        cout << fixed << area << endl;
    }
    return 0;
}

C++:  #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 #include<deque>
 #include<functional>
 #include<utility>
 
 using namespace std;
 
 int main()
 {
   int x,h;
   while(cin>>x>>h&&(x||h))
   {
     double S_base=1.0*x*x;
     double hh=sqrt(1.0*pow(h,2)+1.0*(pow(1.0*x/2,2)));
     double S_side=1.0/2*hh*x;
     double result=S_base+4*S_side;
     printf("%.6lf\n",result);                
   }
   //while(1);
   return 0;
 }

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

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

    }

    return 0;

}

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

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

using namespace std;

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

	scanf("%d", &x);
	scanf("%d", &h);
	while(x != 0 || h != 0){
		if(x == 0){
			printf("0\n");
		scanf("%d", &x);
		scanf("%d", &h);
			continue;
		}
		ans = (1 / cos(atan((double)h * 2 / (double)x)) + 1) * x * x;

		printf("%f\n",ans);
		scanf("%d", &x);
		scanf("%d", &h);

	}
	return 0;
}

C++: #include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<string.h>
#include<vector>
#include<math.h>
#include<queue>
#include <algorithm>
#include<functional>
#include<cstdlib>
#include<cmath>


#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define CI cin >>
#define CO cout <<
#define E << endl;

using namespace std;

typedef pair<int, int> P;
typedef pair<long, long> LP;
typedef pair<int, P> PP;
typedef pair<long, LP> LPP;



int dy[] = { 0, 0, 1, -1, 0 };
int dx[] = { 1, -1, 0, 0, 0 };


double X = 0;
double H = 0;

void input(void) {
	CI X;
	CI H;

	return;
}


int main(void) {
	while (1) {
		input();
		if (X == 0 && H == 0) {
			return 0;
		}
		printf("%.6f", (X * X) + (2 * X * sqrt((H * H) + (X * X) / 4.0)));
	}

	return 0;
}

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

int main()
{
   int i,j,k,l;
   long double x;
   long double h;
   while(1) {
      cin >> x >> h;
      if (x == 0 && h == 0) break;
      printf("%llf\n", x*x + 2 *x * sqrtl(x/2*x/2+h*h));
   }
   
   return 0;
}

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

using namespace std;

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

	scanf("%d", &x);
	scanf("%d", &h);
	while(x != 0 || h != 0){

		ans = (tan((double)h / (double)x) + 1) * x * x;

		printf("%f\n",ans);
		scanf("%d", &x);
		scanf("%d", &h);

	}
	return 0;
}

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

int main(void) {

  int x,h;

  while(1) {

    scanf("%d",&x);

    scanf("%d",&h);

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

    printf("%6lf\n",x*x+2.0*x*sqrt(x*x/4.0+h*h));

  }

  return 0;

}

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

int main()
{	
	double x, h;

	cin >> x >> h;

	while (x > 0 || h > 0) {
		cout << fixed << setprecision(6)
			<< x * x + 2 * x * sqrt(x * x / 4 + h * h) << endl;

		cin >> x >> h;
	}

	return 0;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<math.h>
#define double long double
using namespace std;

int main() 
{
	double a, b, c;
	while (cin >> a >> b, (int)a | (int)b) {
		double s = a*a;
		double m = sqrt(a / 2 * a / 2 + b*b);
		s += a*m * 2;
		cout << s << endl;
	}
}

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

int main()
{
  int x, h;
  while (~scanf("%d %d", &x, &h)) {
    if ((x|h) == 0)
      break;
    printf("%.6f\n", x*x + x*sqrt(static_cast<double>(4*h*h+x*x)));
  }
  return 0;
}

C++: #include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define LOOP(i) while(i--)
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

	while(true){
		int X=in(),H=in();
		if(!X && !H) break;
		double L = hypot(X/2.0,H);
		double S = X*X+2.0*X*L;

		printf("%.10lf\n",S);
	}
	return 0;
}