# Alex Marich
# 7/18/2012
# Solution to BHCSI Contest Problem: House

def main():

    COST_PER_SQFT = 0.60
    
    myFile = open("house.in", "r")
    numCases = int(myFile.readline())

    # Go through each apartment.
    for loop in range(numCases):

        # Read the data.    
        numTAs = int(myFile.readline())
        sqft = int(myFile.readline())

        # Calculate rent, then rent per TA, and print.
        rent = sqft*COST_PER_SQFT
        costPerTA = rent/numTAs
        print("Apartment #",(loop+1),": Each TA pays $",costPerTA,".", sep="")

    myFile.close()
    
main()
