时间限制:C/C++/Rust/Pascal 2秒,其他语言4秒
空间限制:C/C++/Rust/Pascal 256 M,其他语言512 M
64bit IO Format: %lld
题目描述
输入描述:
The first line of input contains integers

and

(

and

).
The next

lines contain the phone numbers,

-th line contains a string

consisting of lowercase English letters (

).
The next q lines contain the information about the questions, each of them contains integers

,

and

(

≤ n and

).
输出描述:
Print the answer for each question in a separate line.
示例1
输入
复制
5 5
a
ab
abab
ababab
b
1 5 1
3 5 1
1 5 2
1 5 3
1 4 5
备注:
来自codeforces:http://codeforces.com/contest/547/problem/E