function bal_seq_unrank_test ( )

%*****************************************************************************80
%
%% bal_seq_unrank_test() tests bal_seq_unrank().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    25 November 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'bal_seq_unrank_test():\n' );
  fprintf ( 1, '  bal_seq_unrank() unranks a balanced sequence of N items.\n' );

  rank = 21;
  n = 5;

  t = bal_seq_unrank ( rank, n );

  fprintf ( 1, '\n' );
  fprintf ( 1, '  Rank = %d\n', rank );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  The element of that rank is:\n' );
  fprintf ( 1, '\n' );
  for i = 1 : 2 * n
    fprintf ( 1, '%2d', t(i) );
  end
  fprintf ( 1, '\n' );

  return
end
