Given two integers ‘n’ and ‘sum’, find count of all n digit numbers with sum of digits as ‘sum’. Leading 0’s are not counted as digits. Print your output % 10^9+7.

**Input:**

The first line contains an integer T, depicting total number of test cases.

Then following T lines contains 2 integers n and sum.

**Output:**

Print the number of digits. Print **-1** if answer is not possible.

**Constraints:**

1<=T<=30

1<=n<=100

1<=sum<=1000

**Example:**

Input:

1

2 2

Output:

2

**Explaination: **2 numbers 11 and 20.

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.

Vagesh Verma | 98 |

UrGuru | 98 |

chaolinyu | 84 |

prernaus24 | 83 |

devendrachoudhary5485 | 74 |

abducodes | 624 |

harshtyagi36 | 298 |

highway_to_hell | 252 |

rajeswarii | 248 |

arpit_anshuman | 240 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4567 |

Login to report an issue on this page.