function x = mcnugget_ways_list ( a, b )

%*****************************************************************************80
%
%% mcnugget_ways_lists() lists solutions to a McNuggets problem.
%
%  Discussion:
%
%     We are given a Diophantine equation 
%
%       a1 x1 + a2 x2 + ... + an * xn = b
%
%     for which the coefficients a are positive integers, and
%     the right hand side b is a nonnegative integer.
%
%     In general, a = [ 6, 9, 20 ] and b is the desired number of 
%     Chicken McNuggets.
%
%     We are seeking to list all nonnegative integer solutions x, that is,
%     the different ways in which a total of b Chicken McNuggets
%     can be assembled by various choices of the packages of 6, 9, and 20.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    12 October 2022
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Scott Chapman, Chris O’Neill,
%    Factoring in the Chicken McNugget Monoid,
%    Mathematics Magazine, 
%    Volume 91, Number 5, 2018, pages 323-336.
%
%  Input:
%
%    integer a(n): the number of McNuggets in each package size.
%
%    integer b: the total number of McNuggets desired.
%
%  Output:
%
%    integer x[?,n]: the number of different ways of getting b McNuggets.
%

%
%  Find all nonnegative integer solutions X of A*X = B.
%
  x = diophantine_nd_nonnegative ( a, b );

  return
end

