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(){

    double x,h;

    while(cin>>x>>h , x || h){
        printf("%lf\n",x * x + sqrt(x / 2.0 * x / 2.0 + h * h) * x / 2.0 * 4);
    }

    return 0;
}

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

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

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

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)):((m)-(n))),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)
#define loop for(;;)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef long double Real;
typedef vector<int> vi;
typedef vector<string> vs;
typedef map<string,int> Dictionary;
const Real PI = acos(-1);

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  if (v.size() == 0) {
    os << "(empty)";
    return os;
  }
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

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

char u[] = {'I', 'V', 'X', 'L', 'C', 'D', 'M'};
int v[] =  {1, 5, 10, 50, 100, 500, 1000};

int value_of (char c) {
  rep (i, 7) {
    if (c == u[i]) return v[i];
  }
}

int div(int a, int b, int n) {
  a %= b;
  a = a * 10;
  if (n == 1) return (a/b);
  return div(a, b, n - 1);
}

int main() {

  loop {
    Real x,h;
    cin >> x >> h;
    if (x == 0 && h == 0) break;
    if (!cin) break;
    Real S = x * x + 2.0 * x * sqrt(h*h + x*x/4.0);
    printf("%0.10Lf\n", S);
  }

  return 0;
}

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

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

  for(;;){
    cin >> x >> h;
    if(x == 0 && h == 0) break;
    nx = (double)x;
    nh = (double)h;
    S = sqrt(4*nh*nh+nx*nx)+nx*nx;
    printf("%.6f\n" ,S);
  }

  return 0;
}

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

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

int main(void)
{
	int n=0,m;
	float ans[10000];
	for(;;)
	{
		float a,b,c,d;
		scanf("%f %f",&a,&b);
		if(a==0&&b==0)
		{
			break;
		}
		c=a/2*a/2+b*b;
		d=sqrt(c);
		ans[n]=a*d/2*4+a*a;
		n++;
	}
	for(m=0;m<n;m++)
	{
		printf("%f\n",ans[m]);
	}
	return 0;
}

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

main(){
	while(true){
		double x, h;
		cin >> x >> h;
		
		if(x==0){
			break;
		}
		
		double H = sqrt(x*x*0.25+h*h);
		
		printf("%.5f\n",x*x + x*H/2.0*4.0);
	}
}

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){
		printf("%.10f\n",(a*a)+2*a*sqrt(((a/2)*(a/2)+b*b)));
	}
}

C++: while true
  x = gets.to_i
  h = gets.to_i
  break if x==0 && h==0
  puts x*x+Math.sqrt(4*h*h+x*x)*x
end

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;
		S += x*(double)sqrt((x*(double)x/4)+(h*h))*2;
		
		printf("%lf\n",S);
	}
}

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

int main(void){
	double x, h, a; //xは底面の1辺の長さ、hは錐の高さ、aは側面の高さ
	
	while(cin >> x >> h) {
		if(x == 0 && h == 0) break;
		
		a = sqrt(h*h + x*x/4);
		
		double S = x*x + x*a*2;
		
		printf("%.6lf\n", S);
	}
	
	return 0;
}

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

int main()
{
  int x, h;
  
  while (cin >> x >> h, x + h){
    double s = 0;
    s += x * x * 1.0;
    double y = sqrt(pow(x / 2.0, 2.0) + pow((double)h, 2.0));
    s += (y * x) / 2.0 * 4.0;
    printf("%.10f\n", s);
  }
  return (0);
}

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

using namespace std;

// x: base length,  h: height of pyramid
double get_surface_area_of_pyramid(int x, int h) {
	double height_of_triangle = sqrt(x * x / 4.0 + h * h);

	return 2 * x * height_of_triangle + x * x;
}

int main(void) {
	int x, h; // 4角推

	while (cin >> x >> h) {
		if (x == 0 && h == 0) {
			break;
		}
		printf("%.6f\n",get_surface_area_of_pyramid(x, h));
	}

	return 0;
}