# The Errors

Father Timm Memorial Prog...
Limits 1s, 512 MB

The government wants to provide relief to the flood-affected people. So, it set a committee. The committee has created a function $F$ to count the number of affected people.

Suppose, the country has $n$ divisions $A_1, A_2, A_3……A_n$. $A_1$ means the first division has $A_1$ districts. $A_2$ means the second division has $A_2$ districts.

In general, $A_i$ means the $i_{th}$ division has $A_i$ districts.

They defined the function F such that $F(i) = \frac{X}{Y}$ where $X = {\prod_{j = 1, i \neq j}^{n}A_j}$, $Y = A_{i}^{2}$. It means the $i_{th}$ division has $\left \lfloor (F_i) \right \rfloor$ affected people.

If they wanted to do the calculation by hand, it would have taken a lot of time. So, they decided to create a robot. If they give the robot, $n$, ($A_1,A_2, …, A_n$), $m$ and ($B_1,B_2, …, B_m$), the robot returns $\sum_{j=1}^{m}\left \lfloor F(B_j) \right \rfloor$.

As they are not experts, the robot has some errors. It can calculate a number x if and only if $x ∈ [0,10^{9}]$ and it calculates the numerator first and then divide it with denominator.

If it takes a number Y and can’t calculate $F(Y)$, it assumes that $F(Y) = 0$. But as the committee members are not sure whether the robot works properly, they hired you as you are an expert mathematician. Can you help them?

In the problem:

• $\prod$ means Pi function.

• $\left \lfloor X \right \rfloor$ means floor function. It returns the largest integer that is smaller than or equal to $X$.

• $\sum$ means Sigma function.

It is guaranteed that $\sum_{j=1}^{m}\left \lfloor F(B_j) \right \rfloor ∈ [0,10^{9}]$.

## Input

Input starts with an integer $T$ ($T \le 100$), denoting the number of test cases. The first line of each test case contains one integer $n$ ($2 \le n \le 30$) the number of divisions in the country. The second line of each test case contains $n$ integers $A_1, A_2, A_3……A_n$ ($0 \le A_i \le 100$), where $A_i$ is the number of districts in $i_{th}$ division.

The third line of each test case contains one integer $m$ ($m \le n$). The fourth line of each test case contains $m$ integers $B_1, B_2, B_3……B_m$. All indices are 1-based.

## Output

For each case print the case number and the the value of $\sum_{j=1}^{m}\left \lfloor F(B_j) \right \rfloor$.

## Sample

InputOutput
1
10
100 10 10 10 10 10 10 10 10 10
2
1 2

Case #1: 100000


Here, $m=2$, $B1 = 1$ and $B2 = 2$

Now, suppose $F(B1) = \frac{X}{Y}$

$X = a_2 \times a_3 \times a_4 \times … \times a_{10} = 1000000000$

and $Y = (100^{2}) = 10000$

then $\frac{X}{Y} = \frac{1000000000}{10000} = 100000$

So $F(B1) = 100000$

Again $F(B2) = \frac{X}{Y}$

$X = a_1 \times a_3 \times a_4 \times … \times a_{10} = 10^{10}$

As $X$ not belongs to $[0,10^{9}]$, it cant calculate $X$

So robot assumes that $F(B2) = 0$

So the final answer is $F(B1)+F(B2) = 100000+0 = 100000$