In a parallel universe called Marvel, an infectious viral disease has been spreading at a very fast rate. Dr. Strange Is trying to create a potion that would prevent people from catching the disease and would also cure the ones already diseased.
He knows that the cure is a potion which is a mixture of N chemicals and is K liters in volume. He does not know the amount of each chemical that must be added and hence is experimenting on the same.
As the assistant of Dr. Strange, you help him in his task and ask him how to prepare the potion, to which he replies:
- Chemicals must be added in the increasing order of their labels.
- The amount of chemicals being added must be between 1 and L where L Is the amount of mixture obtained till that step.
- Exactly 1 liter of the first chemical must be taken
You, along with being a biologist, are a good programmer and mathematician and hence, decide to find the number of potions possible In accordance with Dr. Strange's Instructions using a computer program.
input1: N, The number of chemicals.
input2: K, the total amount of chemical to be added.
Your function should return the required value.
input1: 2
input2: 2
Output: 1
Possible ways:
- chemical 1 - 1L chemical 2 - 1L
input1: 5
input2: 10
Output: 6
Possible ways:
- chemical 1 - 1L, chemical 2 - 1L, chemical 3 - 2L, chemical 4 - 4L, chemical 5 - 2L
- chemical 1 - 1L, chemical 2 - 1L, chemical 3 - 2L, chemical 4 - 3L, chemical 5 - 3L
- chemical 1 - 1L, chemical 2 - 1L, chemical 3 - 2L, chemical 4 - 2L, chemical 5 - 4L
- chemical 1 - 1L, chemical 2 - 1L, chemical 3 - 1L, chemical 4 - 3L, chemical 5 - 4L
- chemical 1 - 1L, chemical 2 - 1L, chemical 3 - 1L, chemical 4 - 2L, chemical 5 - 5L
- chemical 1 - 1L, chemical 2 - 1L, chemical 3 - 1L, chemical 4 - 1L, chemical 5 - 6L