#205. 递归计算兔子耳朵总数
递归计算兔子耳朵总数
Recursive Bunny Ears
Background
Congcong loves small animals, especially cute bunnies. He noticed that different bunnies have different numbers of ears.
Problem Description
We have bunnies standing in a line, numbered . The odd bunnies () have the normal ears. The even bunnies () we'll say have ears, because they each have a raised foot. Recursively return the number of "ears" in the bunny line (without loops or multiplication).
Input Format
Input is given from Standard Input in the following format.
An integer , representing the length of the bunny line.
Output Format
Output is printed to Standard Output in the following format.
An integer, representing the total number of ears for the first bunnies.
Sample
0
0
1
2
2
5
Sample Explanation
For , there are no bunnies, so the total number of ears is . For , there is only bunny , which is odd-numbered and has ears. Total is . For , there are bunny and bunny . Bunny is odd-numbered and has ears. Bunny is even-numbered and has ears. Total is .
Constraints
Time limit: second, Memory limit: KiB for each test case.