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 <cstdio>
#include <iostream>
#include <math.h>

using namespace std;

typedef long long ll;

int main(){
	double x,h;
	double sum_pow;
	double height,sum;

	cin >> x >> h;

	while(x != 0 && h != 0){
		sum_pow = (x/2)*(x/2) + h*h;
		height = sqrt(sum_pow);
		sum = x * x + x * height * 2;

		printf("%lf\n",sum);

		cin >> x >> h;
	}

}

C++: #include <iostream>
#include <math.h>
using namespace std;
int main(void)
{
	double x,h;
	while(cin >> x >> h){
		if(!x) break;
		double s;
		s=x*(x+2*sqrt(h*h+x*x/4));
		printf("%f\n",s);
	}
	return 0;
}

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

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

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

using namespace std;

int main()
{
	int x, h;
	while (true) {
		cin >> x >> h;
		if (x==0 && h==0) break;
		
		double surface_area = static_cast<double>(x*x) + 2.0 * static_cast<double>(x) * sqrt(static_cast<double>(h*h+x*x/4.0));
		cout << fixed << setprecision(6) << surface_area << endl;
	}
	
	return 0;
}

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

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

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

int main(){

  int x, h;
  double s;

  while(cin >> x >> h){
    if(x == 0) break;
    s = 2.0 * x * sqrt(0.25 * x * x + h * h);
    s += (double)x * x;
    printf("%lf\n", s);
  }

  return 0;

}

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

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

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++: // 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++: // 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++: // 2011/03/29 Tazoe

#include <iostream>
#include <cmath>
using namespace std;

int main()
{
	while(true){
		int x;
		cin >> x;
		int h;
		cin >> h;
		if(x==0&&h==0)
			break;

		double S1 = (double)(x*x);
		double S2 = (double)x*sqrt((double)(x*x+4*h*h));

		cout.precision(6);
		cout << fixed << S1+S2 << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>

using namespace std;

int main()
{
	while ( true )
	{
		int x, h;
		cin >> x >> h;

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

		double area = x * x;
		area += 2 * sqrt( pow( x / 2.0, 2 ) + pow( h, 2 ) ) * x;

		cout << area << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main (){
	while(1){
	int x,h; double S;
	cin >> x >> h ; if(x==0&&h==0) break;
	S=x*sqrt((double)4*h*h+x*x)+x*x ;
	cout << fixed << setprecision(6) ;
	cout << S << '\n' ;
	};
}