{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"我们要统计给出的字符串s和若干个单词,有多少种方法把字符串拆成这些单词。\u003c/p\u003e\n"}},{"title":"输入","value":{"format":"HTML","content":"输入多组数据,每组数据给定一个字符串s, |s|\u003c\u003d300 000\u003c/p\u003e\n接下来的一行给出一个数 n , 1\u003c\u003dn\u003c\u003d4000 表示有n个单词\u003c/p\u003e\n\n后面的n 行每行输入一个单词\n"}},{"title":"输出","value":{"format":"HTML","content":"输出方案数,取模 20171027"}},{"title":"Sample Input","value":{"format":"HTML","content":"abcd\n\u003cbr\u003e4\n\u003cbr\u003ea\n\u003cbr\u003eb\n\u003cbr\u003ecd\n\u003cbr\u003eab"}},{"title":"Sample Output","value":{"format":"HTML","content":"Case 1: 2\u003c/p\u003e"}}]}