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 <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
#define INF 114514
using namespace std;



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

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

using namespace std;

double gets(double x, double h){
    return 2 * x * sqrt( x * x / 4 + h * h) + x * x;
}

int main(){
    int x, h;
    cout << fixed << setprecision(10);
    while(true){
        cin >> x;
        cin >> h;
        if(x == 0 && h == 0) break;
        cout << gets(x, h) << endl;
    }
}

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

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

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++: // 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 <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",ans);
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main()
{
	double x, h;
	while (cin >> x >> h)
	{
		if (x == 0.0 && h == 0.0) break;
		printf("%.6f\n", (x*x + 4.0*(x*sqrt(h*h+(x*x)/4.0))/2.0));
	}
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  double x,h;
  while(cin>>x>>h&&x){
    double a=x*x;
    a+=sqrt(h*h+a/4)*x*2;
    printf("%f\n",a);
 }
  return 0;
}

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

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

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

  return 0;
}

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

int main(void)
{
	int x, h;
	
	while (scanf("%d %d", &x, &h)){
		if (x == 0 && h == 0) break;
		
		double res = 0;
		
		res = (x * sqrt((4 * h * h) + (x * x))) + (x * x);
		
		printf("%.6lf\n", res);
	}
	
	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 <cmath>

using namespace std;

double surfaceArea(double x, double h)
{
  return x*x + x*sqrt(4*h*h+x*x);
}

int main()
{
  int x, h;

  while(cin>>x>>h && x != 0 && h != 0){
    printf("%.6lf\n", surfaceArea((double)x, (double)h));
  }

  return 0;
}

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

#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL

int main() {
	cout << fixed << setprecision(6);
	for (int x, h; cin >> x >> h&&x;) {
		cout << x*x + sqrt(h*h + x/2.*x/2.)*x / 2. * 4 << endl;
	}
	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 <cmath>
#include <cstdio>
using namespace std;

int main(){
  double S,nx,xh;
  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;
}