Program Quiz;
Var t,q,i:integer;
    n,k,j:longint;
    A:array [0..5000000] of longint;
    B:array [1..10] of longint;
begin
 Read(t);
 for i:=1 to t do
 begin
  A[0]:=0;
  Read(n,q);
  for j:=1 to n do
  begin
   Read(k);
   A[j]:=A[j-1]+k;
  end;
  B[i]:=0;
  for j:=1 to n do
   for k:=j to n do
    if ((k-j+1)*q/100)<=(A[k]-A[j-1]) then
    B[i]:=B[i]+1;
 end;
 for i:=1 to t do
 Write(B[i],' ');
end.