Problem description Washington in the bedroom wash clothes, met Xyf, so xyf out a question to Washington to do (but there is no relationship-v-!)
XYF throw to Washington N strings, these strings are not more than 10000 in length and have no empty strings. There are Q queries, each asking for a k, to find that the substrings in the N string contain the number of k strings (see hint for details) input multiple sets of tests.
Each group of tests first enters n,q to represent n strings, Q asks. (1<= N, Q <=1e4)
Next n lines a string si per line, (1<= |si| <= 1e4)
Then the Q line asks, each query input an integer k (1<=k<=n)
Can tell you a group of inquiries in ∑ (SI) <= 5e4;output each query output an answer, a row, indicating the number of K-strings included cheat in, haha
2016 C Language Program Design Competition (junior group), Jiangxi University of Technology