Find the flux leaving the surface of the sphere: What will the position of line charges look like diagrammatically?
This should probably get a homework tag, but here goes:
Since I can't give you a 3D image on a 2D screen, let's just take a slice.  Luckily the problem is set up to do that reasonably easily.  We can represent two at the same, z = +1 and z = -1.  The equation for the sphere in A is $$(x-3)^2+(y-1)^2+z^2=2^2$$
for z = +/- 1
$$(x-3)^2+(y-1)^2+1=4$$
$$(x-3)^2+(y-1)^2=3$$
So we can draw a circle with center (3,1) and radius sqrt(3) in the z = +/-1 slice.  Since y = 1 is the center, the y = 1, z=+/-1 lines will run right through the center of our slices and the total distance will be the diameter 2*sqrt(3) in both cases for a total distance of \$ 4 \cdot \sqrt3 \$
meters.  Multiply by 20 for \$80 \cdot \sqrt3 \$ nC
Problem B is a little tougher

But with a bit of geometry we can show that the chord is 2sqrt(2) for each slice, thus a total charge of \$ 4 \cdot \sqrt2 \$ meters or \$ 80 \cdot \sqrt2 \$ nC