**Problem : The Vita Sum**

**Statement**

Tom the cat is brushing up his Math skills. He has a bag containing N balls of different colors. Now Tom can randomly pick any even number of balls from the bag. Tom wants to find out the sum of all such combinations of balls that he can pull out from the bag. He can pull out at max K balls in one pick.

**Input Format:**

First line contains two space separated numbers N and K

**Output Format:**

The output is the sum of all the combinations of balls he can pull out modulo 10^9+7 i.e. (1000000007)

**Constraints:**

- 0<=N,k<=10^14
- N >= k

**Sample Input and Output**

SNo. | Input | Output | Explanation |
---|---|---|---|

1 | 4 4 | 8 | We need ^{4}C_{0} + ^{4}C_{2}+ ^{4}C_{4}= 1+6+1=8 |

2 | 8 3 | 29 | We need ^{8}C_{0} + ^{8}C_{2}= 1+28=29 |

## No comments :

## Post a Comment