Conspicuousness
题号:NC222866
时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld

题目描述



One day,  found a password consisting of numbers from  ~ . She wants to know how conspicuous this password is to  has a visual threshold of , and only the number whose length is not less than  can be noticed by him.

We define  as the number of occurrences of the number  in the password .

Then we define the conspicuousness  of a password :

Noticed:  means number  is a subnumber of the password . For example,  is true and  is not.

Since  does not know the visual threshold , please help calculate the conspicuousness  under the  kinds of situations.

输入描述:

The first line contains two positive integers  and , indicating the length of the password and the number of situations;

The second line contains a number with a length of , which represents the password discovered by ;

In the next  line, each line has a positive integer , which represents the visual threshold of .

输出描述:

The output should contain  lines, each representing the conspicuousness  in different situations.
示例1

输入

复制
3 2
131
1
2

输出

复制
2
1
示例2

输入

复制
3 2
666
3
2

输出

复制
1
2