var
  Z, K, N, M, I, J: Integer;
  R, S: Real;

begin
  Readln(Z);
  while Z > 0 do
  begin
    Dec(Z);
    Readln(K, N);
    R := 0;
    M := 0;
    while N > 0 do
    begin
      Dec(N);
      Readln(I);
      S := I - R;
      if N > 0 then
      begin
      J := Trunc(S) div K;
      Inc(M, J + 1);
      S := S - J * K;
      R := Sqrt(K * K - S * S);
      end
      else
      begin
        Inc(M, Round(S / K));
      end;
    end;
    Writeln('Strazny ujde ', M, ' ponorku.');
  end;
 
end.