function [ know, x ] = p12_sol ( m, know )

%*****************************************************************************80
%
%% p12_sol returns the solution for problem 12.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    19 December 2011
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer M, the spatial dimension.
%
%    integer KNOW, 0, or the index of the previously returned solution.
%
%  Output:
%
%    integer KNOW, 0 if there are no more solutions, or it is the
%    index of the next solution.
%
%    real X(M,1), the solution, if known.
%
  for i = 1 : m
    alpha(i,1) = i / ( m + 1 );
  end

  if ( know == 0 )
    know = 1;
    x(1:m,1) = alpha(1:m,1);
  else
    know = 0;
    x(1:m,1) = 0.0;
  end

  return
end
