Road Shop
Time limit1sMemory limit128 MB
Count the number of ways to choose bead counts for n colors summing to r, with at least m beads of each color.
- Level
Medium4 of 10
- Topics
- Combinatorics, Math, Dynamic programming
- Solved
- No attempts yet
Problem
Having lost interest in computer science, Sang-geun opened a road shop whose flagship product is bead necklaces. He has an unlimited supply of beads in different colors. He wants to make a necklace of exactly beads, using at least beads of every one of the colors. Two necklaces are counted as different kinds only when the combination of how many beads of each color they use differs (the order or arrangement of the beads is not distinguished). How many different kinds of necklaces can Sang-geun make?
Input
The first line contains three integers , , and , separated by spaces.
Output
Print the number of different kinds of necklaces that can be made.