# Arup Guha
# 7/16/2012
# Solution to BHCSI Contest Problem: Ball Pit

import math

def main():

    myFile = open("ballpit.in", "r")

    numCases = int(myFile.readline())

    # Go through each case.
    for i in range(numCases):

        # Read in all the data for this case.
        wholeLine = myFile.readline()
        data = wholeLine.split()
        length = int(data[0])
        width = int(data[1])
        height = int(data[2])
        radius = int(data[3])

        # Just used for clarity in the following calculation.
        diameter = 2*radius

        # Measure the length, width and height of the pit in ball units.
        numBalls = (length//diameter)*(width//diameter)*(height//diameter)

        # Volume for all the balls is here.
        volume = numBalls*4/3*math.pi*(radius**3)

        print("Ball Pit #",i+1,": ",numBalls," balls are needed with total volume ",volume,".",sep="")

main()
