#define PI acos(-1.0)
#define ll long long int
const int maxn = 1e2 + 5;
using namespace std;
struct point {
double x,y,z;
point() {
}
point(double a, double b,double c) {
x = a;
y = b;
z = c;
}
point operator -(const point &b)const {
return point(x - b.x, y - b.y,z-b.z);
}
point operator +(const point &b)const {
return point(x + b.x, y + b.y,z+b.z);
}
point operator *(const double &k)const {
return point(x * k, y * k,z*k);
}
point operator /(const double &k)const {
return point(x / k, y / k,z/k);
}
double operator *(const point &b)const {
return x*b.x + y*b.y+z*b.z;
}
};
double dist(point p1, point p2) {
return sqrt((p1 - p2)*(p1 - p2));
}
struct sphere {
double r, area, tj;
point centre;
};
sphere s,a[maxn];
void SphereInterVS(sphere a, sphere b,double &v,double &s) {
double d = dist(a.centre, b.centre);
double t = (d*d + a.r*a.r - b.r*b.r) / (2.0 * d);
double h = sqrt((a.r*a.r) - (t*t)) * 2;
double angle_a = 2 * acos((a.r*a.r + d*d - b.r*b.r) / (2.0 * a.r*d));
double angle_b = 2 * acos((b.r*b.r + d*d - a.r*a.r) / (2.0 * b.r*d));
double l1 = ((a.r*a.r - b.r*b.r) / d + d) / 2;
double l2 = d - l1;
double x1 = a.r - l1, x2 = b.r - l2;
double v1 = PI*x1*x1*(a.r - x1 / 3);
double v2 = PI*x2*x2*(b.r - x2 / 3);
v = v1 + v2;
double s1 = PI*a.r*x1;
double s2 = PI*a.r*x2;
s = 4 * PI*(a.r*a.r + b.r*b.r) - s1 - s2;
}
void solve() {
int n; cin >> n;
double x, y, z, r;
for(int i = 1; i <= n; i++) {
scanf("%lf%lf%lf%lf",&x,&y,&z,&a[i].r);
a[i].centre = {x,y,z};
}
scanf("%lf%lf%lf%lf",&x,&y,&z,&r);
s.r = r;
s.centre = {x,y,z};
double ans = 0, v = 0;
for(int i = 1; i <= n; i++) {
double ss, dis = dist(s.centre, a[i].centre);
if(dis >= s.r + a[i].r)continue;
if(dis + min(s.r, a[i].r) <= max(s.r, a[i].r))
{
ans += 4.0 / 3.0 * PI * min(s.r,a[i].r) * min(s.r,a[i].r) * min(s.r,a[i].r);
continue;
}
SphereInterVS(s, a[i], v, ss);
ans += v;
}
printf("%.8f
" ,ans);
}