UVA-900 - Brick Wall Patterns

  • UVa Online Judge 解題結果請於 Submit 後,參閱 uHunt
  • 如果你有任何建議與指教,歡迎於下方留言一起討論喔!
  • 相同題目:ZOJ-d038

題意概要

題目假設牆的高度為 ,並給定牆之長度,試問:要築起這道牆,磚塊的排列總共有多少種樣式。規則如下:


Input

Your program receives a sequence of positive integers, one per line, each representing the length of a wall. The maximum value for the wall is length . The input terminates with a 0.


Output

For each wall length given in the input, your program must output the corresponding number of different patterns for such a wall in a separate line.


Sample Input

1
2
3
0

Sample Output

1
2
3
profile-image
David Lu
Hello, I'm David Lu. I am a graduate student in Department of Computer Science at National Chiao Tung University, Taiwan. I am in the Networking and Sensing Systems (NSS) Lab at NCTU. If you have any question, please feel free to contact with me.
comments powered by Disqus