One day, Mikasa found a password consisting of numbers from . She wants to know how conspicuous this password is to Allen. Allen has a visual threshold of , and only the number whose length is not less than kkk 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 Mikasa 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 Mikasa;
In the next line, each line has a positive integer , which represents the visual threshold of Allen.
输出
The output should contain lines, each representing the conspicuousness in different situations.
样例
标准输入 复制文本 |
3 2 131 1 2 |
标准输出 复制文本 |
2 1 |
标准输入 复制文本 |
3 2 666 3 2 |
标准输出 复制文本 |
1 2 |
来源
2021 GDCPC 广东省大学生程序设计竞赛