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

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

C++: #include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>

typedef long long int ll;


using namespace std;

int x,h;
double y;
double ans;

int main(){
	while(1){
		cin>>x>>h;
		if(x==0&&h==0)break;
		y=sqrt(4*h*h+x*x)/2.0;
		ans=x*(2*y+x);
		printf("%.15lf\n",ans);
	}
}

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

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

int main() {
  while(1) {
    int x, h;
    double area,x2;
    cin >> x >> h;
    if(x==0 && h==0) break;

    area=x*x;
    x2=(double)x/2;
    area+=(double)2*sqrt(h*h+x2*x2)*x;

    printf("%f\n",area);
  }
  return 0;
}

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

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 <string>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <typeinfo>
#include <map>
#define INF 100000000
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
typedef long long ll;

double is(double x,double h){
    return x*x + 2*x * sqrt( h*h + (0.25)*x*x );
}


int main(){
    int x,h;
    while(1){
        cin>>x>>h;
        if(x==h && x==0)break;
        
        printf("%15.10lf\n",is(x,h));
    }
    return 0;
}

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

int main(void)
{
	double a, h;

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

C++: #include <iostream>
#include <string>
#include <vector>
#include <cstdio>
#include <math.h>
using namespace std;
int main(){
    double x,h,temen,ht,mt,hyomen;
    for(;;){
        cin>>x>>h;
        if(x==0&&h==0)break;
        temen=x*x;
        ht=(x/2)*(x/2);
        h=h*h;
        mt=sqrt(ht+h);
        hyomen=(mt*x)*2+temen;
        printf("%.6f",hyomen);
        cout<<endl;
    }
    return 0;
}

C++: #include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;

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

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

using namespace std;

int main(void){
	double x,h;
	while(scanf("%lf%lf", &x, &h) && x != 0 && h != 0 ){
		double y = sqrt( (x/2)*(x/2) + h*h );
		printf("%lf\n",2*y*x+x*x);
	}
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int x, h;
    while(cin >> x >> h, x|h){
        printf("%.10lf\n", x*hypot(x, h*2)+x*x);
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <vector>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)

using namespace std;

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

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

int main(){
	double x, h, y;
	while(scanf("%lf%lf", &x, &h) != EOF){
		if(x+h == 0)break;
		y = sqrt((x/2.0)*(x/2.0) + h*h);
		printf("%f\n", x*y*2 + x*x);
	}
	return 0;
}