1406 文件名查找


Submit solution

Points: 100
Time limit: 1.0s
Memory limit: 32M

Problem types
Allowed languages
C, C++, Java, Python

Description

在目录里用搜索查找文件是很方便的 但是这究竟是怎样一个过程呢?

Input

第一行为2个整数n,m(0<n,m<=10), 接着有n行字串, 每行包含数据Ni,表示文件名(无空格), 后面是m行查询, 每行包含数据Si,表示要查询的文件名前缀。

Output

对于每个查询,输出以Si为前缀的文件总数。

Sample

Input

6 5
SearchIndexer.exe
npmproxy.dll
schtasks.exe
KBDSORST.DLL
DRWATSON.EXE
wdi.dll
WavD
KB
Com
DRWAT
odbc

Output

0
1
0
1
0

Source: 仙剑魔


Comments

There are no comments at the moment.