#include <cmath>
#include <iomanip>
#include <iostream>


#define EPSILON 1e-9


class vector_t {
public:
  double x;
  double y;
  double z;

public:
  vector_t(double x = 0, double y = 0, double z = 0) : x(x), y(y), z(z) {};

public:
  double operator*(const vector_t& v) const {
    return x * v.x + y * v.y + z * v.z;
  };

  vector_t operator^(const vector_t& v) const {
    return vector_t(y * v.z - z * v.y,
                    z * v.x - x * v.z,
                    x * v.y - y * v.x);
  };

public:
  double length() const {
    return sqrt(*this * *this);
  };
};


class point_t {
public:
  double x;
  double y;
  double z;
  double w;

public:
  point_t(double x = 0, double y = 0, double z = 0, double w = 1) : x(x), y(y), z(z), w(w) {};
  
public:
  vector_t operator-(const point_t& p) const {
    return vector_t(x - p.x, y - p.y, z - p.z);
  };
};


int main(int argc, char** argv)
{
  int x, h;

  while (1) {
    std::cin >> x >> h;

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

    point_t p1(x / 2.0, 0, x / 2.0), p2(x / 2.0, 0, -x / 2.0), p3(0, h);

    std::cout <<
      std::setprecision(12) << ((p2 - p1) ^ (p3 - p1)).length() * 2 + x * x << std::endl;
  }
}