整数拆分 Ver.2

Time Limit:1000MS  Memory Limit:65535KB
Description:
The problem is, given an positive integer N, we define an equation like this:
  N=a[1]+a[2]+a[3]+...+a[m];
  a[i]>0,1<=m<=N;
For example, assume N is 5, we can find:
  5=1+1+1+1+1
  5=1+1+1+2
  5=1+1+3
  5=1+2+2
  5=1+4
  5=2+3
  5=5
Note that "5 = 3 + 2" and "5 = 2 + 3" is the same in this problem. Now, you do it!"
But now , you must ouput all the equations in lexicographical order;
Input:
The input contains several test cases. Each test case contains a positive integer N(1<=N<=20) which is mentioned above. The input is terminated by the end of file.
Output:
For each test case, you have to output several lines indicate the different equations you have found.
Sample test:
Input
3
4
Output
3=1+1+1
3=1+2
3=3
4=1+1+1+1
4=1+1+2
4=1+3
4=2+2
4=4
Note:
The first case,you can't print 3=2+1(it's not lexicographical order),and you must print 3=1+1+1 before 3=1+2 .
Source:
Author:
ACSolo