logo AlgoBeat OnlineJudge
登录 注册

#102780. [BZOJ 2780] [Spoj]8093 Sevenk Love Oimaster

内存限制:128 MiB 时间限制:1000 ms 标准输入输出
题目类型:传统 评测方式:文本比较
上传者: 匿名

题目描述

Oimaster and sevenk love each other.

But recently,sevenk heard that a girl named ChuYuXun was dating with oimaster.As a woman's nature, sevenk felt angry and began to check oimaster's online talk with ChuYuXun.

Oimaster talked with ChuYuXun times, and each online talk actually is a string.Sevenk asks questions like this, "how many strings in oimaster's online talk contain this string as their substrings?"

题意:给出 个串 次询问,每次给定一个串 ,问 是多少个 的子串。

输入格式

There are two integers in the first line, the number of strings ​and the number of questions.
And lines follow, each of them is a string describing oimaster's online talk.
And lines follow, each of them is a question.

输出格式

For each question, output the answer in one line.

样例

样例输入 #1

3 3
abcabcabc
aaa
aafe
abc
a
ca

样例输出 #1

1
3
1

数据范围与提示

对于 的数据,