// Dan Gau
// 7/18/2012
// Solution to BHCSI Contest Problem: Resistor

import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;

public class resistor {

	private static final char[] TotalResistance = null;

	public static void main(String[] cheese) throws FileNotFoundException{
		
		Scanner stdin = new Scanner(new File("resistor.in"));
		
		int numcases = stdin.nextInt();
		int i, j, k;
		
		for(i=0; i<numcases; i++){
			
			int numResistors = stdin.nextInt();
			int[] resistors = new int[numResistors];
			
			// Read in the resistors.
			for(j=0;j<numResistors;j++)
				resistors[j] = stdin.nextInt();
			
			String arrangement = stdin.next();
			
			double totalResistance = resistors[0];
			
			// Go through adding each new resistor.
			for(k=0;k<arrangement.length();k++){

				if (arrangement.charAt(k) == 'S')
					totalResistance += resistors[k+1];
				else 
					totalResistance = (totalResistance * resistors[k+1]) / (totalResistance + resistors[k+1]);
			}

			// Output the answer.
			System.out.println("Circuit Board #"+(i+1)+": "+totalResistance+" Ohms");
		}
		
		stdin.close();
		
	}
}
