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 <cmath>
#include <cstdio>

using namespace std;

int main()
{
	int x, h;
	double x2 = 2.0;
	double X, H;
	double S;
	
	while (1){
		cin >> x >> h;
		
		if (x == 0 && h == 0){
			break;
		}
		
		X = x * x;
		x2 = x / x2;
		H = sqrt(x2 * x2 + h * h);
		
//		cout << X << " " << x2 << " " << H << endl;
		
		S = X + (H * x2) * 4;
		
		printf("%f\n", S);
	}
}

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

using namespace std;

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

        while (1){
                scanf("%lf", &x);
                scanf("%lf", &h);

                if (x == 0.0 && h == 0.0){
                        break;
                }

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

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

        return (0);
}

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

using namespace std;

int main()
{
	int x, h;
	double x2 = 2.0;
	double X, H;
	double S;
	
	while (1){
		cin >> x >> h;
		
		if (x == 0 && h == 0){
			break;
		}
		
		X = x * x;
		x2 = x / x2;
		H = sqrt(x2 * x2 + h * h);
		
		cout << X << " " << x2 << " " << H << endl;
		
		S = X + (H * x2) * 4;
		
		cout << S << endl;
	}
}

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

double root(double x){
	double e = 0.00000001;
	double a = x;
	double b = 0;
	double c;
	while(a - b > e){
		c = (a + b) / 2;
		if(c * c < x){
			b = c;
		}else{
			a = c;
		}
	}
	return c;
}

int main(){
	double x;
	double h;
	while(cin >> x >> h){
		double area = x * x + 2 * root((x * x / 4) + (h * h)) * x;
		cout << showpoint << setprecision(15) << area << endl;
	}
	return 0;
}

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

#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++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

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

C++: #include<iostream>
#include<iomanip>
#include<cmath>
using namespace std;
int p, q; double s;
int main() {
	while (1) {
		cin >> p >> q;
		if (!p) { break; }
		s += p*p;
		s += 2.0 * p * sqrt(q*q + (double)(p*p) / 4);
		cout << fixed << setprecision(15) << s << endl;
	}
}

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

using namespace std;

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

  return 0;
}

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

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 <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;
    }
    
}

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

int main(){
double x,h,c,a;
while(1){
scanf("%lf%lf",&x,&h);
if(x==0&&h==0)break;
c=4*h*h+x*x;
c=sqrt(c);
a=x*c+x*x;
printf("%f\n",a)




return 0;
}

C++: #include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

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

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

#define sq(a) (a*a)

int main() {
  
  double x, h;

  while(cin>>x>>h) {
    cout << setprecision(100) << sq(x)+ x * ( sqrt(sq(x/2)+sq(h)) ) * 2 << endl;
  }
  
  return 0;
}

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

int main() {
  double x,h;
  while(true) {
    cin>>x>>h;
    if(!x) break;
    cout.precision(11);
    cout<<showpoint<<x*x+2*x*sqrt(x*x/4+h*h)<<endl;
  }
}

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

C++: #include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 2000000000
int main(){
	double a,b;
	while(scanf("%lf %lf",&a,&b) && a+b!=0.0){
		double w=sqrt(a*a/4.0+b*b);
		double ans=w*a*2.0;
		ans+=a*a;
		printf("%f\n",ans);
	}
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <memory.h>
#include <cassert>
#include <iomanip>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define present(c, e) ((c).find((e)) != (c).end())
#define cpresent(c, e) (find(all(c), (e)) != (c).end())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;



int main() {
	for (double s, h; cin >> s >> h, (s != 0 && h != 0); ) {
		double x = sqrt(h * h + s * s / 4.0);
		cout << setprecision(10) << s * x * 2.0 + s * s << endl;
	}
	return 0;
}

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

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

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

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

int main(){
	double x, h;

	while ( cin >> x >> h && !( !x && !h ) ){
		cout << setprecision( 6 ) << setiosflags( ios::fixed );
		cout << x * x + 2 * x * sqrt( x * x / 4 + h * h ) << endl;
	}
	return 0;
}

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

#define set fixed << setprecision(6)
#define square pow(x, 2)
#define triangle x * sqrt(pow(h, 2) + pow(x / 2, 2)) / 2

int main() {
	double x, h;
	while (1) {
		cin >> x >> h; if (x == 0 && h == 0) break;
		cout << set << square + 4 * triangle << endl;
	}
	return 0;
}