How many times to repeat?
The positive integer number N is given. We subtract from this number the sum of its digits. From the received number we soon subtract the sum of its digits and so on. This operation continues until the number is positive. How many times this operation will be repeated?
Specifications
Input
The number N, 0 < N < 2000000000.
Output
The number of performed operations.
Problem information
Time Limit: 10 secondsMemory Limit: 64 MB
Balls for the passed test: 10
Complexity: 29% 703/988
Example
Example input23 |
Example output3 |
| ← Degree of symmetry | Problems | Corruption → |
