#include #include #include #include #include using namespace std; const double eps = 1e-4; int Cx[3], Cy[3], Rx[3], Ry[3]; int main() { cin.sync_with_stdio(false); for (int i = 0; i < 3; ++i) cin >> Cx[i] >> Cy[i] >> Rx[i] >> Ry[i]; vector > V; double area = 0; for (double i = -75.00; i <= 75.00; i += eps) { V.clear(); for (int j = 0; j < 3; ++j) { double term = 1.0 - (1.0 * (i - Cx[j]) * (i - Cx[j])) / (1.0 * Rx[j] * Rx[j]); if (term < -eps) continue; term *= 1.0 * Ry[j] * Ry[j]; term = fabs(term); term = sqrt(term); double yn1 = Cy[j] - term; double yn2 = Cy[j] + term; V.push_back(make_pair(yn1, 1)); V.push_back(make_pair(yn2, -1)); } sort(V.begin(), V.end()); int totnow = 0; for (int j = 0; j < int(V.size()) - 1; ++j) { totnow += V[j].second; if (totnow > 0) area += (V[j + 1].first - V[j].first) * eps; } } cout << fixed << setprecision(4) << area << '\n'; }