#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include using namespace std; #define rep(i,n) for(int i = 0; i < (n); ++i) #define rrep(i,n) for(int i = (n)-1; i >= 0; --i) #define chmax(a, b) a = max(a, b) #define chmin(a, b) a = min(a, b) #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() using ll = long long; using P = pair; using VI = vector; using VVI = vector; using VL = vector; using VVL = vector; int main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(12); double rmax, h, d; cin >> rmax >> h >> d; const double rmin = d / 2; constexpr int num = 5e7; const double rstep = (rmax - rmin) / num; double ans = 0; rep(i, num) { //for(double r = rmin; r < rmax; r += rstep) { const double r = rmin + rstep * i; double t = acos(d / 2 / r); //ans += r * r * (2 * t - sin(2 * t)); double x = 2 * t; double x2 = x * x; ans += r * r * (x2 * x / 6 * (1 - x2 / 20 * (1 - x2 / 42 * (1 - x2 / 72 * (1 - x2 / 110))))); } ans *= rstep * h / rmax; cout << ans << endl; } /* int main() { constexpr int attempts = 1e8; int hits = 0; double R, H, D; cin >> R >> H >> D; std::default_random_engine generator(std::chrono::system_clock::now().time_since_epoch().count()); //std::default_random_engine generator(0); // [-R, D + R] * [-R, R] * [0, H] std::uniform_real_distribution<> xdist(-R, D + R), ydist(-R, R), zdist(0, H); const double RH = R / H; for(int i = attempts; i; i--) { const double x = xdist(generator), y = ydist(generator), z = zdist(generator); const double dl = x * x + y * y, dr = (x - D) * (x - D) + y * y, r = z * RH; const double r2 = r * r; if (dl <= r2 && dr <= r2) hits++; } cout << fixed << setprecision(12); cout << double(D + 2 * R) * 2 * R * H * hits / attempts << endl; } */