atcoder#ABC156E. [ABC156E] Roaming
[ABC156E] Roaming
Score : points
Problem Statement
There is a building with rooms, numbered to .
We can move from any room to any other room in the building.
Let us call the following event a move: a person in some room goes to another room .
Initially, there was one person in each room in the building.
After that, we know that there were exactly moves happened up to now.
We are interested in the number of people in each of the rooms now. How many combinations of numbers of people in the rooms are possible?
Find the count modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of possible combinations of numbers of people in the rooms now, modulo .
3 2
10
Let , , and be the number of people in Room , , and now, respectively. There are possible combination of :
For example, will be if the person in Room goes to Room and then one of the persons in Room goes to Room .
200000 1000000000
607923868
Print the count modulo .
15 6
22583772