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 <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=10000009;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
int main() {
	double x,h,s,t;
	double S;
	while(true){
		cin>>x>>h;
		if(x==0&&h==0) break;
		t=x*x*0.25+h*h;
		t=pow(t,0.5);
		s=0.5*x*t*4.0;
		S=s+x*x;
		fcout(6)<<S<<endl;
	}
}

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

int main(){
	double x, h;
	double S;
	
	while(true){
		scanf("%lf%lf", &x, &h);
		
		if(x == 0 && h == 0) break;
		
		S = x * x + x * sqrt(x * x / 4 + h * h) * 2;
		
		printf("%lf\n", S);
	}
	
	return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<vector>
#include<cstdio>
#include<cstring>
#include<climits>
#include<cfloat>
#include<cmath>
#include<map>
#include<complex>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define DBL(x) ((x)*(x))

typedef unsigned int uint;
typedef long long ll;

using namespace std;

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

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

int main(void) {
	int x, h;
	double S;
	
	while(1) {
		S = 0;
		scanf("%d %d", &x, &h);
		if(!x && !h)
			break;

		S += x * x;
		S += x * sqrt(x * x + 4 * h * h);

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

	return 0;
}

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

int main(){
  double x, h;
  while (cin >> x >> h) {
    if (x == 0 && h == 0) break;
    double y = sqrt(h * h + (x * 0.5) * (x * 0.5));
    double ans = x * x + x * y * 0.5 * 4;
    cout << fixed << setprecision(6) << ans << endl;
  }
}

C++: #include <iostream>
#include <math.h>
#include <stdio.h>
#include <cstdio>
using namespace std;
int main(){
	int x,h;
	while(1){
		cin>>x;
		cin>>h;
		if(x==0 && h==0) break;
		double s=(double)(x*x)+(double)x*(sqrt((double)(x*x)+4.0*(double)(h*h)));
		printf("%.6lf\n",s);
	}
	return 0;
}

C++: import java.util.*;

public class Main {
  Scanner sc = new Scanner(System.in);
  double x, h;
  void run() {
    for(;;) {
      x = sc.nextInt();
      h = sc.nextInt();
      if (x == 0 && h == 0) break;
      //System.out.println(x + "|" + h);
      double l = Math.sqrt(x*x/4 + h*h);
      double res = x*x + 2 * x * l;
      System.out.println(res);
    }
  }
  public static void main(String args[]) {
    new Main().run();
  }
}

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

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

using namespace std;

int main()
{
	for(;;){
		int x;
		int h;
		double S = 0;
		
		cin >> x >> h;
		
		if(x == 0 && h == 0){
			break;
		}
		
		S += x*x;
		
		cout << S << endl;
		S += x*(double)sqrt((x*(double)x/4)+(h*h))*2;
		
		printf("%lf",S);
	}
}

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

C++: 

/*
#include<stdio.h>
#include<iostream>
#include<math.h>
using namespace std;

int main(){

double x,h,W=0,X=0,S=0;
while(1){
scanf("%lf %lf",&x,&h);
if(x==0&&h==0)break;
X=0.5*x;
W=sqrt(X*X+h*h);
S=x*x+2*W*x;
cout<<S<<endl;

}
return 0;
}

*/

#include<stdio.h>
#include<iostream>
#include<math.h>
using namespace std;

int main(){

double x,h,W,S=0,R=0,PI;
PI=3.141592;
while(1){
scanf("%lf %lf",&x,&h);
if(x==0&&h==0)break;
R=atan2( h, 0.5*x );
W=0.5*x/cos(R);
//W=sqrt(x*x+h*h);
S=x*x+2*W*x;
cout<<S<<endl;
}
return 0;
}

C++: #include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    double x,h;
    while(cin>>x>>h){
        if(x==0&&h==0) {
            break;
        }
        cout<<setprecision(10)<<x*x+2*x*sqrt(h*h+x*x/4)<<endl;
    }
    return 0;
}

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

using namespace std;

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

	while(1) {
		cin >> x;
		cin >> h;
		if (x == 0 && h == 0) {
			break;
		}
		k = sqrt(pow((double)x/2.0,2) + pow((double)h,2));
		s = pow((double)x,2) + (double)x * k * 2;
		printf("%f\n",s);
	}

	return 0;
}

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

int main() {
    for (;;) {
        double x, h;
        scanf("%lf%lf", &x, &h);
        if (x == 0 && h == 0) return 0;
        const double y = sqrt(x*x/4+h*h);
        printf("%.6f\n", x*x+2*x*y);
    }
}

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

C++: #include<bits/stdc++.h>
using namespace std;
using P = pair<int, int>;

int main() {
    while (1) {
        int x, h;
        cin >> x >> h;
        if (!x) return 0;
        double l = sqrt(h * h + x * x * 0.25);
        printf("%.9lf\n", x * (x + l * 2));
    }
}

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

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

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

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

double getHypotenuse( double a , double b )
{
	return sqrt( pow( (double)a , 2 ) + pow( (double)b , 2 ) );
}

int main(void)
{
	int x, h;

	while(1){
		std::cin >> x >> h;
		if( x == 0 && h == 0 ){
			break;
		}
		printf( "%5.9f\n",(double)x * (double)x + 2.0 * x * getHypotenuse( (double)x/2.0 , (double)h ) );
	}

	return 0;
}

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

using namespace std;

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