Candies

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Rikka is poor at math. Yuta is worried about that, so he gives Rikka some math tasks to practice. One of them is described below.

There are nn children and mm kinds of candy. The ii-th child has A_iA\_i dollars, and the unit price of the ii-th kind of candy is B_iB\_i. There is an infinite supply of candy of each kind.

Each child has her favorite candy, so she will buy this kind of candy as much as possible and will not buy any candy of other kinds. For example, if a child has 1010 dollars, and the unit price of her favorite candy is 44 dollars, then she will buy two candies and go home with 22 dollars left.

Yuta does not know any child's favorite candy. Now Yuta has qq queries, each of them consists of an integer kk. For each query, Yuta wants to know the number of pairs (i,j)(i, j) (1in1 \leq i \leq n, 1jm1 \leq j \leq m) with the following property: if the ii-th child's favorite candy is the jj-th kind, she will take kk dollars home.

To make the problem easier, it is only required to calculate the answers modulo 22. Help Rikka solve this problem for Yuta!

입력

The first line of the input contains three integers nn, mm and qq (1n,m,q51041 \leq n, m, q \leq 5 \cdot 10^4).

The second line contains nn integers A_iA\_i (1A_i51041 \leq A\_i \leq 5 \cdot 10^4).

The third line contains mm integers B_iB\_i (1B_i51041 \leq B\_i \leq 5 \cdot 10^4).

The fourth line contains qq integers k_ik\_i which describe the queries (0k_i<max(B_1,B_2,,B_m)0 \leq k\_i < \max (B\_1, B\_2, \ldots, B\_m)).

It is guaranteed that A_iA_jA\_i \neq A\_j and B_iB_jB\_i \neq B\_j for all iji \neq j.

출력

For each query, print a single line with a single integer: the answer to the query modulo 22.