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.

sabka_din_aayega | 309 |

maggiiiii | 230 |

Anugrah_kumar | 172 |

UtkarshMalik | 150 |

Savage_19 | 146 |

Bishnu Dev Panda | 777 |

sabka_din_aayega | 620 |

Anugrah_kumar | 562 |

okayboss | 552 |

yk12 | 514 |

blackshadows | 5331 |

Ibrahim Nash | 5219 |

akhayrutdinov | 5111 |

mb1973 | 4925 |

Quandray | 4547 |

Login to report an issue on this page.