Consistent Occurrences

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

문제

Let us define a consistent set of occurrences of string tt in string ss as a set of occurrences of tt in ss such that no two occurrences intersect (in other words, no character position in ss belongs to two different occurrences).

You are given a string ss consisting of nn lowercase English letters, and mm queries. Each query contains a single string t_it\_i.

For each query, print the maximum size of a consistent set of occurrences of tt in ss.

입력

The first line contains two space-separated integers nn and mm: the length of string ss and the number of queries (1n1051 \le n \le 10^{5}, 1m1051 \le m \le 10^{5}).

The second line contains the string ss consisting of nn lowercase English letters.

Each of the next mm lines contains a single string t_it\_i consisting of lowercase English letters: the ii-th query (1t_in1 \le |t\_i| \le n, where t_i|t\_i| is the length of the string t_it\_i).

It is guaranteed that the total length of all t_it\_i does not exceed 10510^{5} characters.

출력

For each query ii, print one integer on a separate line: the maximum size of a consistent set of occurrences of t_it\_i in ss.