/* Question: calculate the number of the sum of numbers in the range [1 to 10 ^ 9;
Idea: Define DP [I] [J] (I = 1 to 9, j = 1 to 81), which indicates the sum of the numbers with the bits of I and the sum of the bits of J.
Number. DP [I] [J] = (I-1 bits complement 0) + (J-K {k | 1 <= k <= 9 }). Therefore
The moving equation is
DP [I] [J] = DP [I-1] [J] + sum (DP [I-1] [J-1], DP [I-1] [J-2],..., DP [I-1] [j-9]);
PS: note that S = 1 is 10 instead of 9, because 10 ^ 9 is also included in S = 1.
My code :*/
# Include <iostream>
# Include <fstream>
# Include <cstring>
Using namespace STD;
Int DP [15] [85];
Int main (){
// Fstream CIN ("data. In ");
Int I, J, K;
Memset (DP, 0, sizeof (DP ));
For (I = 1; I <= 9; I ++ ){
DP [1] [I] = 1;
}
For (I = 2; I <10; I ++ ){
For (j = 1; j <= 81; j ++ ){
DP [I] [J] = DP [I-1] [J];
For (k = 1; k <= 9 & J-k> = 0; k ++ ){
DP [I] [J] + = DP [I-1] [J-K];
}
}
}
Int S, ans;
While (CIN> S ){
If (S = 1) {cout <"10 \ n"; continue ;}
For (ANS = 0, I = 1; I <10; I ++ ){
Ans + = DP [I] [s];
}
Cout <ans <Endl;
}
Return 0;
}