#include using namespace std; #define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i> R >> H >> D; constexpr int Z = 1 << 28; double dz = 1.0 / Z; double ret = 0.0; REP(t, Z) { double u = dz * (0.5 + t); if (D / (2 * R) > u) continue; double theta = acos(D / (2 * R) / u); ret += u * u * (theta * 0.5 - sin(theta * 2) * 0.25); } cout << fixed << setprecision(20) << ret / Z * 4 * R * R * H << '\n'; }