John is a very calm person. He loves children very much. As his birthday is coming, he decided to give some gifts to the poor children and wants to make them happy by giving them the balls. But his enemy does not like his idea and therefore he wants to destroy John's Plan. So, his enemy takes away the balls as much as he can in the absence of John. John becomes very sad and thinks how he would distribute the remaining balls so that all the children feel happy. Therefore our task is to find the number of ways of distributing the balls. If he can distribute it, output number of ways else print "-1" without quotes.

**Input:**

First line of the input contains an integer **T**, denoting number of test cases. Then T test cases follow. Each test case consists of two lines. The first line of each test case consists of three integers **m, n** and **p** denoting **total number of balls**,** number of children** and the **balls enemy has taken** respectively. The second line of each test case consists of n space separated integers denoting minimum number of balls needed by a child numbered i, where 1<= i <= n.

**Output:**

If he can distribute, print the number of ways **mod 10 ^{9}+7**, else print "

**Constraints:**

1 <= T <= 100

1 <= m <= 1000

2 <= n <= 100

1 <= p <= 1000

**Example:
Input **

2

13 4 5

2 3 1 3

30 10 14

2 2 1 1 1 2 2 3 1 1

**Output**

-1

1

Author: AdityaChatterjee

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

bruceewayne | 193 |

manvirag982 | 182 |

Core_Ka_Bachha | 180 |

shivam123ahuja | 175 |

Sanjana Singh 1 | 173 |

mr_kksparrow | 433 |

manvirag982 | 398 |

TheHandle | 291 |

rajupraaa1234 | 276 |

Exception_404 | 268 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4567 |

Login to report an issue on this page.