Input file: | input.txt | Time limit: | 2 sec | |
Output file: | output.txt | Memory limit: | 64 Mb |
Define the function sum_of_digits(a)⟨a∈N0⟩=k∑i=0ai where {ai} is the representation of a in the numeral system with radix 10.
Define the function:
digitalization(a)⟨a∈N0⟩={
ifsum_of_digits(a)∈0..9{
returnsum_of_digits(a)
}
else{
returndigitalization(sum_of_digits(a))
}
}
Your problem is to find digitalization(n!) for given n.
n
digitalization(n!)
No. | Input file (input.txt ) |
Output file (output.txt ) |
---|---|---|
1 |
|
|
2 |
|
|