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++: // clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
// #define main int main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
#define stlice(from, to) substr(from, (to) - (from) + 1)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
using namespace std;
using pii = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vpii = vector<pii>;
using vvi = vector<vi>;
using vvb = vector<vb>;
using vvpii = vector<vpii>;
template<typename A> using fn = function<A>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
constexpr bool odd(const int &n) { return n & 1; }
constexpr bool even(const int &n) { return !odd(n); }
template<typename V> constexpr typename V::value_type sum(const V &v) { return accumulate(all(v), 0); }
void solve();
main { solve(); return 0; }
// clang-format on

void solve() {
  double x, h;
  while (cin >> x >> h, x) {
    cout << prec(8) << x * x + x * hypot(h, x / 2) * 2 << endl;
  }
}

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

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

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

double calc(int x, int h) {
    return((2.0 * x) * sqrt(h*h + (x*x) / 4.0) + x*x);
}

int main(void) {
    int x, h;
    
    while(cin >> x >> h, x||h) {
        printf("%.6f\n", calc(x, h));
    }
    return(0);
}

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

int main() {
	int x,h;
	double S;
	
	while(cin>>x>>h,x|h){
		S = x*x + 2*sqrt(0.25*x*x+h*h)*x;
		cout<<S<<endl;
		
	}
	return 0;
}

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

using namespace std;

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

C++: #include<stdio.h>
#include<math.h>
int main(void)
{
	float 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==0 && h==0) break;
    double soku = sqrt(((double)x*0.5) * ((double)x*0.5)+ (double)h*(double)h);
    cout<<(double)x*(double)x + (double)4 * (soku * (double)x * 0.5) <<endl;
  }
}

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

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

while(cin>>x>>h){
    if(x==0&&h==0){
        break;
    }
    height=sqrt(x*x*0.5*0.5+h*h);
    ans=(double)(x*x+4*(x*height*0.5));

    printf("%.6f\n",ans);
}
    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;
    cout << fixed << setprecision(8)
         << x * x + x * hypot(h, x / 2) * 2 << "\n";
  }
}

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

int main() {
  int x,h;
  double S;
  while(cin >> x >> h) {
    if((x==0)&&(h==0)) break;
    S = (double) x * x + (double) x * sqrt(h*h+x*x/4.0) / 2.0 * 4.0;
    printf("%.6f\n",S);
  }
}

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

using namespace std;

int main(){
        int x,h;
        cin >> x >> h;
        while(x||h){
                printf("%.6f\n",2*x*pow((double)x*x/4+(double)h*h,0.5)+x*x);
                cin >> x >> h;
        }   
}

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

int main() {
    int x, h;
    while (cin >> x >> h) {
        if (x == 0 && h == 0) break;
        double _h = sqrt( x*x/4.0 + h*h );
        printf("%.6f\n", x*x + x * _h * 2);
//        cout << x*x + x * _h * 2 << endl;
    }
    return 0;
}

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

using namespace std;

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

C++: #include<iostream>
#include<string.h>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

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

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

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

C++: #include<iostream>
#include<vector>
#include<math.h>
using namespace std;
int main() {
	vector<double>l;
	double x, h;
	while (cin >> x >> h){
		if (x == 0 && h == 0)break;
		double a, b;
		a = x / 2 * sqrt(x*x/4 + h*h);
		b = x*x;
		l.push_back(a * 4 + b);
	}
	for (double i:l) {
		printf("%.6f\n",i);
	}
	char c;
	cin >> c;
}

C++: #include <cmath>
#include <cstdio>
#include <iostream>
int main(){
	int x,h;
	while(std::cin>>x>>h,x!=0||h!=0)std::printf("%.6f\n",x*x+2*x*sqrt(x*x*.25+h*h));
}

C++: #include<bits/stdc++.h>
using namespace std;
using ll = int64_t;
using ld = long double;
int main(){
    while(1){
        ld x, h;
        cin >> x >> h;
        if(!x && !h) break;
        ld po = sqrt(pow(h, 2) + pow(x / 2, 2));
        printf("%.100Lf\n", x * po * 2 + x * x);
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <map>
#include <functional>
#include <array>

using namespace std;

int main(){
    double x, h;
    while(true){
        cin >> x >> h;
        if(x == 0 && h == 0) break;
        cout << fixed;
        cout << x * x + x * 2 * sqrt(x * x / 4 + h * h) << endl;
    }
}

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

using namespace std;

int main(void){
    
    int x,h;
    double sh;
    double sx;
    double ss;
    double s;
    
    
    while(cin>>x>>h,x!=0||h!=0){
        sh=h*h;
        sx=(double)(x/2.0)*(x/2.0);
        ss=sqrt(sh+sx);
        s=(double)(x)*(x)+4*ss*x*0.5;
    
        printf("%.6lf\n",s);
    }
    return(0);
}

C++: #include<stdio.h>
#include<math.h>
int main(void)
{
	float 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;
		printf("%f\n",c);
		c = sqrt(c);
		c = x*x + x*c/2.0*4.0;
		printf("%f\n",c);
	}
	return 0;
}

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

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