Thunder String

0

0 votes
Medium-Hard
Problem

Pikachu came up with a new puzzle of strings in which he would give us the length of the string and a thunder value associated with that string.

Thunder value of any string is calculated as the sum of all the characters in their alphabetic position.

eg. Thunder value of abc=1+2+3=6, bad=2+1+4=7 ['a' is treated as 1, 'b' is treated as 2, 'c' as 3 and so on]

Now, he wants us to calculate number of such strings that satisfy the above conditions and have only lowercase letters in strictly ascending order.

Input

First line contains an integer T, number of test cases.
Each test case contains two integers L(Length of string) and X(Thunder Value).

Output

For each test case print total number of strings satisfying the puzzle.

Constraints

  • 1 ≤ T ≤ 1000
  • 1 ≤ L ≤ 10000
  • 1 ≤ X ≤ 10000
Sample Input
3
2 4
4 10
3 8
Sample Output
1
1
2
Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

For the third test case the strings satisfying the condition are : abe , acd.

Editor Image

?