var a:array[1..500000] of byte;
     n,q,i,j,t,k,s,z:longint;

begin

 readln(t);

 for k:=1 to t do
 begin
 z:=0;
   read(n,q);
   for i:=1 to n do
   read(a[i]);
   for i:=1 to n do
   begin
     s:=0;
     for j:=i to n do begin
     s:=s+a[j];
     if (s/(j-i+1)*100>=q) then inc(z);
     end;
   end;
   write(z,' ');
 end;

end.

