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

int main(){
	
	int x,h,y,num=0;
	
	while(1){
	
	scanf("%d %d",&x,&h);
	
	y=sqrt(x*x+h*h);
	num=x*x+2*x*y;
	if((x==0)&&(h==0)){
			break;
	}
		
	printf("%d",num);
	
		
	}

C++: #include<iostream>
#include<cmath>
#include<iomanip>
using namespace std;
int main(void){
    double x,h,S,H;
    while(cin >> x >> h){
        if(x==0 && h==0)    break;
        else{
            H=sqrt(h*h+(x/2)*(x/2));
            S=x*x+x*(H/2)*4;
            std::cout << std::fixed << std::setprecision(6) << S << endl;
        }
    }
}

C++: while true
  x, h = 2.times.map{gets.to_i}
  break if x==0 && h==0
  puts x*x+Math.sqrt(4*h*h+x*x)*x
end

C++: #include<stdio.h>
#include<math.h>
int main(void)
{
	double x,h,s,x1,h1,s1,s2;
	scanf("%lf",&x);
	scanf("%lf",&h);
	while(!(x==0.0 && h==0.0)){
		
		s=sqrt(h*h+x/2*x/2);
		x1=x*x;
		s1=x*s/2*4+x1;
		
		printf("%lf\n",s1);
		scanf("%lf",&x);
		scanf("%lf",&h);
	}
	return 0;
}

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

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

double root(double x){
	double e = 0.00000001;
	double a = x;
	double b = 0;
	double c;
	while(a - b > e){
		c = (a + b) / 2;
		if(c * c < x){
			b = c;
		}else{
			a = c;
		}
	}
	return c;
}

int main(){
	double x;
	double h;
	while(cin >> x >> h){
		if(x == 0 && h == 0) break;
		double area = x * x + 2 * root((x * x / 4) + (h * h)) * x;
		cout << showpoint << setprecision(15) << area << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
#define rep2(x,from,to) for(int x = (from); x < (to); ++(x))
#define rep(x,to) rep2(x,0,to)
int main() {
	int x, h;
	while(cin >> x >> h && (x || h)) {
		double height = sqrt(pow((double)x/2,2.0) + pow(h,2.0));
		printf("%.6lf\n", x * (x + height * 2));
	}
	return 0;
}

C++: #include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <list>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <bitset>
#include <complex>
using namespace std;

const double EPS = 1e-9;
const double PI = 3.14159265359;

typedef complex<double> P;

int main(){
	double x, h;

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

	return 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;
	while(cin>>x>>h,x)
	{
		printf("%.9lf\n",x*x+x*0.5*sqrt(x*x*0.5*0.5+h*h)*4);
	}
  return 0;
}

C++: #include<stdio.h>
#include<math.h>
int main(void)
{
	double x,h,S,y,l;
	while(1){
	scanf("%lf %lf",&x,&h);
	if(x==0 && h==0){
		break;
	}
	y=x*x;
	l=sqrt(h*h+(x/2)*(x/2))*x*2;
	S=y+l;
	printf("%f\n",S);
	}
	return 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;
  }
}