#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using Int = long long; template ostream &operator<<(ostream &os, const pair &a) { return os << "(" << a.first << ", " << a.second << ")"; }; template void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; } template bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; } template bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; } using Double = long double; struct Pt { Double x, y; Pt() {} Pt(Double x, Double y) : x(x), y(y) {} Pt operator+(const Pt &a) const { return Pt(x + a.x, y + a.y); } Pt operator-(const Pt &a) const { return Pt(x - a.x, y - a.y); } Pt operator*(const Pt &a) const { return Pt(x * a.x - y * a.y, x * a.y + y * a.x); } Pt operator/(const Pt &a) const { const Double d2 = a.abs2(); return Pt((x * a.x + y * a.y) / d2, (y * a.x - x * a.y) / d2); } Pt operator+() const { return Pt(+x, +y); } Pt operator-() const { return Pt(-x, -y); } Pt operator*(const Double &k) const { return Pt(x * k, y * k); } Pt operator/(const Double &k) const { return Pt(x / k, y / k); } friend Pt operator*(const Double &k, const Pt &a) { return Pt(k * a.x, k * a.y); } Pt &operator+=(const Pt &a) { x += a.x; y += a.y; return *this; } Pt &operator-=(const Pt &a) { x -= a.x; y -= a.y; return *this; } Pt &operator*=(const Pt &a) { return *this = *this * a; } Pt &operator/=(const Pt &a) { return *this = *this / a; } Pt &operator*=(const Double &k) { x *= k; y *= k; return *this; } Pt &operator/=(const Double &k) { x /= k; y /= k; return *this; } Double abs() const { return sqrt(x * x + y * y); } Double abs2() const { return x * x + y * y; } Double arg() const { return atan2(y, x); } Double dot(const Pt &a) const { return x * a.x + y * a.y; } Double det(const Pt &a) const { return x * a.y - y * a.x; } friend ostream &operator<<(ostream &os, const Pt &a) { os << "(" << a.x << ", " << a.y << ")"; return os; } }; const Double EPS = 1e-10; const Double INF = 1e+10; const Double PI = acos(-1.0); inline int sig(Double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; } inline Double tri(const Pt &a, const Pt &b, const Pt &c) { return (b - a).det(c - a); } double aCC(Pt a, double r, Pt b, double s) { double d = (a - b).abs(); if (sig(r - s - d) >= 0) return s * s * PI; if (sig(s - r - d) >= 0) return r * r * PI; if (sig(r + s - d) <= 0) return 0; double x = (d * d + r * r - s * s) / (d * 2); double h = sqrt(r * r - x * x); return r * r * atan2(h, x) + s * s * atan2(h, d - x) - d * h; } constexpr int N = 1'000'000; Double R, H, D; int main() { for (; ~scanf("%Lf%Lf%LF", &R, &H, &D); ) { Double ans = 0.0L; for (int i = 0; i <= N; ++i) { const Double r = R / N * i; const Double res = aCC(Pt(0.0L, 0.0L), r, Pt(D, 0.0L), r); ans += ((i == 0 || i == N) ? 1 : (i % 2 == 0) ? 2 : 4) * res; } ans *= (H / N) / 3.0L; printf("%.12Lf\n", ans); } return 0; }