UVA-10721 - Bar Codes

  • UVa Online Judge 解題結果請於 Submit 後,參閱 uHunt
  • 如果你有任何建議與指教,歡迎於下方留言一起討論喔!
  • 本題選為「20161220 大學程式能力檢定 CPE」題目。
  • 相同題目:NCTU-11187

題意概要

題目給定 個連續排列的長條形條碼 (Bar code),條碼可為黑色或或白色,顏色相同且相鄰的條碼視為一個部分; 試球:將 個條碼分成 個部分,且每個部分都不超過 的分法數。


Input

Each input will contain three positive integers , , and ().


Output

For each input print the total number of symbols in . Output will fit in -bit signed integer.


Sample Input

7 4 3
7 4 2

Sample Output

16
4
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