哈希表没有裸题。。。
初学蒟蒻只好自己瞎搞搞。。。
大神勿喷。。
var
i,j,k,t,n,m,x:longint;
a:array[1..100]of longint;
function hash(x:longint):longint;
begin
hash:=x mod 12;
end;
function locate(x:longint):longint;
var
t,i,j:longint;
begin
t:=hash(x);
i:=0;
while (i<12)and(a[t+i]mod 12<>x)and(a[t+i]mod 12<>0) do inc(i);
locate:=(t+i)mod 12;
end;
procedure insert(x:longint);
begin
a[locate(x)]:=x;
end;
function member(x:longint):longint;
begin
member:=locate(x);
end;
begin
readln(n,m);
fillchar(a,sizeof(a),0);
for i:=1 to n do
begin
read(x);
insert(x);
end;
for i:=1 to m do
begin
readln(k);
writeln(member(k));
end;
end.