[Html]
# Include <iostream>
Using namespace std;
Const int _ max = 121;
// C1 is the number of quality weights that can be combined.
// C2 indicates the intermediate quantity, which is not saved once.
Int c1 [_ max], c2 [_ max];
Int main ()
{// Int n, I, j, k;
Int nNum ;//
Int I, j, k;
While (cin> nNum & nNum)
{
For (I = 0; I <= nNum; ++ I) // ---- ①
{
C1 [I] = 1;
C2 [I] = 0;
}
For (I = 2; I <= nNum; ++ I) // ----- ②
{
For (j = 0; j <= nNum; ++ j) // ----- ③
For (k = 0; k + j <= nNum; k + = I) // ---- ④
{
C2 [j + k] + = c1 [j];
}
For (j = 0; j <= nNum; ++ j) // ---- ⑤
{
C1 [j] = c2 [j];
C2 [j] = 0;
}
}
Cout <c1 [nNum] <endl;
}
Return 0;
}
# Include <iostream>
Using namespace std;
Const int _ max = 121;
// C1 is the number of quality weights that can be combined.
// C2 indicates the intermediate quantity, which is not saved once.
Int c1 [_ max], c2 [_ max];
Int main ()
{// Int n, I, j, k;
Int nNum ;//
Int I, j, k;
While (cin> nNum & nNum)
{
For (I = 0; I <= nNum; ++ I) // ---- ①
{
C1 [I] = 1;
C2 [I] = 0;
}
For (I = 2; I <= nNum; ++ I) // ----- ②
{
For (j = 0; j <= nNum; ++ j) // ----- ③
For (k = 0; k + j <= nNum; k + = I) // ---- ④
{
C2 [j + k] + = c1 [j];
}
For (j = 0; j <= nNum; ++ j) // ---- ⑤
{
C1 [j] = c2 [j];
C2 [j] = 0;
}
}
Cout <c1 [nNum] <endl;
}
Return 0;
}