|
|||
BarcodesA barcode symbol consists of alternating dark and light bars, starting with a dark bar on the left. Each bar is a number of units wide. Figure 1 shows a barcode symbol consisting of 4 bars that extend over 1 + 2 + 3 + 1 = 7 units.
In general, the barcode BC(n,k,m) is the set of all symbols with k bars that together extend over exactly n units, each bar being at most m units wide. For instance, the symbol in Figure 1 belongs to BC(7,4,3) but not to BC(7,4,2). Figure 2 shows all 16 symbols in BC(7,4,3). Each “1” represents a dark unit, each “0” a light unit.
Input SpecificationEach input line will contain three positive integers n, k, and m (1 ≤ n, k, m ≤ 50). Output SpecificationFor each input line, print the total number of symbols in BC(n,k,m). Output will fit in a 64-bit signed integer. Sample Input
Output for Sample Input
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |