// Arup Guha
// 4/21/2024
// Alternate Solution to 2024 COP 4516 Team Final Contest Problem: Sokka’s Market Math

import java.util.*;

public class market {

	final public static long MOD = 1000000007L;
	
	public static void main(String[] args) {
	
		Scanner stdin = new Scanner(System.in);
		int nC = stdin.nextInt();
		
		// Process cases.
		for (int loop=0; loop<nC; loop++) {
		
			// Get # of input values.
			int n = stdin.nextInt();
			
			// 1 way to make 0 cents change --> empty set.
			long[] dp = new long[100];
			dp[0] = 1;
			
			// Read each value.
			for (int z=0; z<n; z++) {
			
				// Parsing shenanigans to get cents.
				StringTokenizer tok = new StringTokenizer(stdin.next(), ".");
				tok.nextToken();
				int item = Integer.parseInt(tok.nextToken());
			
				// Just trying to avoid weird mod issues.
				long[] next = new long[100];
				
				// I can loop whichever way I want since I am going into a new array.
				for (int i=0; i<100; i++) {
				
					// If we add prev to i, we get a number divisible by 100...
					int prev = i-item >= 0 ? i-item : i-item+100;
					
					// So dp[i] represents not adding this item into the subset.
					// dp[prev] counts the subsets that include this item, meaning that
					// the rest of the items add up to cost prev.
					next[i] = (dp[i] + dp[prev])%MOD;
				}
				
				// Update for next round.
				dp = next;
			}
			
			// This is all we can buy.
			System.out.println(dp[0]);
			
		}
	}
}