ZOJ Problem Set - 2771
Considering a light entering three adjacent planes of glass.
At any meeting surface, the light may either reflect or continue straight through. For example, here is the light bouncing five times before it leaves the glass.
Given the times the light bounces before leaving the glass, you are asked to tell how many different paths the light can take before leaving the glass.
Input contains serverl test cases, each test case contains only one integer n (0 <= n <= 60) indicates how many bounces the light take.
Output how many different paths the light can take.
n = 0, the light leave the glass without any bounces, it go straight through the glass.
n = 1, there are three ways for the light to travel with one bounce--bounce at the middle two meeting faces plus the bottom one.
Author: ZHU, Kai
Source: ZOJ Monthly, October 2006