// Arup Guha
// 7/17/2012
// Solution to BHCSI Contest Problem: Ballpit

import java.util.*;
import java.io.*;

public class ballpit {
	
	public static void main(String[] args) throws Exception {
		
		Scanner fin = new Scanner(new File("ballpit.in"));
		
		int numCases = fin.nextInt();
		
		// Go through each case.
		for (int loop=1; loop<=numCases; loop++) {
			
			// Get all the input data.
			int length = fin.nextInt();
			int width = fin.nextInt();
			int height = fin.nextInt();
			int radius = fin.nextInt();
			int diameter = 2*radius;
			
			// Note: It's important to group and divide as show to avoid overflow.
			int numballs = (length/diameter)*(width/diameter)*(height/diameter);
			double volume = numballs*4.0/3*Math.PI*Math.pow(radius, 3);
			
			System.out.println("Ball Pit #"+loop+": "+numballs+" balls are needed with total volume "+volume+".");
		}
		
		fin.close();
	}
}