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 <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>

#define ll (long long)
#define REP(i,n) for(int i = 0;i<(int)n;i++)
#define FOR(i,a,b) for(int i = (a);i < (b);i++)
#define RFOR(i,a,b) for(int i = (a);i>(b);i--)


using namespace std;


int main(void)
{
    double h,x;
    double answer[1000] = {0};
    int i,j,k,l = 0;
    
    while(cin >> x >> h ,x+h)
    {
        double trih = sqrt((x /2)*(x/2)+(h*h));
        //cout << trih << endl;
        double tris = ((trih)*x) /2;
        //cout << tris << endl;
        double answers = 4*tris+(x*x);
        //cout << answers << endl;
        answer[l] = answers;
        l++;
    }
    REP(i, l)
    cout << answer[i] << endl;
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	long long int a = 0;
	long long int b = 0;
	while (cin >> a, cin >> b)
	{
		long long int c = 0;
		c = a*a*(a*a + b*b);
		long long int d = 0;
		d = sqrt(c * 10000000000);
		cout << a * a + d / 100000 << '.' << d % 100000 << endl;

	}
	
	return 0;
}

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

using namespace std;

int main(void){
  double x,h;
  while(cin >> x >> h,x&&h)
    cout << x*x + sqrt((x*x)/4+h*h) *x *2<< endl;

  return 0;
}

C++: #include<bits/stdc++.h>
#define int double
using namespace std;
 
signed main(){
int a,b;
while(cin>>a>>b,a||b){
    int c=a*a;
    int d=sqrt((a*a/4)+b*b);
    c+=a*d*2;
    cout<<fixed<<setprecision(10)<<c<<endl;
    }
}

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

int main(void){
	int x,h;
	while(cin >> x >> h,x|h){
		double ans=1.0*x*x;
		double hypo=sqrt(0.25*x*x+1.0*h*h);
		ans+=2.0*x*hypo;
		cout.precision(10);
		cout << fixed << ans << endl;
	}
	return 0;
}

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

using namespace std;

int main() {

	double x, h, S;

	while(cin >> x >> h) {
		if(x==0&&h==0)
			break;
		S=x*(x+2*sqrt(x*x/4+h*h));
		cout << S << endl;
	}

	return 0;

}

C++: #include<iostream>
#include<math.h>
#include<iomanip>
using namespace std;
int main(void){
    int x,h;
    while(true){
        cin>>x>>h;
        if(x==0&&h==0)
            break;
        double s=x*x;
        s+=x*2*(double)sqrt((double)x*x/4+h*h);
        cout<<fixed<<setprecision(6)<<s<<endl;
    }
    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(){
	long double x, h;
	long 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<cmath>

using namespace std;

int main(void){
  int x,h,s;
  while(cin >> x >> h,x|h)
    cout << x*x+sqrt((x*x)/4+h*h)*x*2 << endl;

  return 0;
}

C++: import java.util.*;

public class Main {
  Scanner sc = new Scanner(System.in);
  double x, h;
  void run() {
    for(;;) {
      x = sc.nextInt();
      h = sc.nextInt();
      if (x == 0 && h == 0) break;
      System.out.println(x + "|" + h);
      double l = Math.sqrt(x*x/4 + h*h);
      double res = x*x + 2 * x * l;
      System.out.println(res);
    }
  }
  public static void main(String args[]) {
    new Main().run();
  }
}

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 S = (double)x*(double)x+4.0*(double)x*sqrt(((double)x/2)*((double)x/2)+(double)h*(double)h)/2.0;
		printf("%.6lf\n",S);
	}
	return 0;
}

C++: //Surface Area of Quadrangular Pyramid
#include<bits/stdc++.h>
using namespace std;

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

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
 
using namespace std;
 
int main ( void )
{
    int ix, ih;
    while (cin >> ix >> ih, ix|ih) {
        double x = ix, h = ih;
        double th = sqrt((x*x*0.25) + (h*h));
        double s = x * x + 2.0 * x * th;
        printf("%.7f\n", s);
    }
    return 0;
}

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

#define rep(i, n) for(int i = 0; i < n; i ++)
#define ALL(T) T.begin(), T.end()
#define mp make_pair
#define pb push_back

using namespace std;

typedef pair<int, int> pii;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<string> vs;

int main(void){
    for(int x, h; cin >> x >> h, x; printf("%.6f\n", x * (x + 2 * sqrt(pow(x / 2., 2.) + pow(h, 2.)))));

    return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int x,y,s;
	while(x==0 && y==0){
		
		scanf("%d",&x);
		scanf("%d",&y);
		s=x*y*4;
		printf("%d",s);
	}
	
	return 0;
}

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

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

C++: #include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
  int x,h;
  while(cin>>x>>h,x||h){
    printf("%f\n",x*x+2*x*(double)sqrt((double)x*x/4+h*h));
  }


}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
  while(true){
    int x,h;
    scanf("%d%d",&x,&h);
    if(x+h==0)return 0;
    // x/2, h, ?
    double sha = sqrt(x*x/4.0 + 1.0*h*h);
    double ans = x*x*1.0 + 4.0*x*sha/2.0;
    printf("%.9f\n",ans);
  }
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <sstream>
#include <vector>
#include <string>
#include <iomanip>
#include <bitset>
using namespace std;
#define INF	100000000
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define fi first
#define sec second
#define lb lower_bound
#define ub upper_bound
#define SS stringstream
#define rep(i,n) for(int i = 0; i < n; i++)
#define sz(x) ((int)(x).size())
#define SORT(x) sort((x).begin(), (x).end())
#define RSORT(x) sort((x).begin(), (x).end(), greater<int>() )
#define clr(a,b) memset((a),(b),sizeof(a))
typedef long long int ll;
typedef pair<int, int> P;
typedef vector<int> Vi;
typedef vector<ll> Vll;
typedef vector<P> Vp;
typedef priority_queue<P, vector<P>, greater<P> > PQ;

int x,h;
double ans;

int main(){
	while(true){
		scanf("%d%d", &x, &h);
		if(x == 0 && h == 0) break;
		ans = (double)(x*x)+sqrt((double)(h*h)+(double)(x*x/4.0))*(double)x*2.0;
		printf("%.9f\n", ans);
	}
}

C++: #include <bits/stdc++.h>

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  int x, h;
  while (cin >> x >> h, x) {
    cout << x * x + hypot(h, x / 2.) * x * 2 << endl;
  }

  return 0;
}

C++: #include<stdio.h>
#include<math.h>

int main(){
	
	int x,h,y,num[200]={0},i,con=0;
	
		for(i=0;;i++){
	scanf("%d %d",&x,&h);
	
			y=sqrt((double)(x*x/4+h*h));
			num[i]=(double)(x*x+2*x*y);
			con=con+1;
	if((x==0)&&(h==0)){
			con=con-1;
			break;
		
	}
		
		}
	
		
	
	for(i=0;i<con;i++)printf("%f\n",(double)(num[i]));
	return 0;
}