#t333. 数的计算(count)
数的计算(count)
Counting Numbers
Problem Background
Special for beginners, ^_^
Problem Description
We want to count how many numbers (including the input natural number ) satisfy the following property. First read a natural number , then process it as follows:
- Do nothing to it;
- Add a natural number to its left, but this natural number must not exceed half of the original number;
- After adding the number, keep applying this rule until no more natural number can be added.
Input Format
One natural number .
Output Format
One integer: the count of numbers that satisfy the property.
Sample Input
6
Sample Output
6
Constraints
1s, 1024KiB for each test case.
Hint
The numbers that satisfy the property are:
.