Ayla is 11 years-old kid and she likes this beautiful number very much. Today, she prepared a new interesting problem for you based on 11. She gives you k and m, and asks to find the number of positive integers having each digit (from 0 to 9) occurring exactly k times andgiving m modulo 11. Surely, the number cannot have leading zeros.
The first line contains the number of test cases t.
Each of the next t lines contains k (1 ≤ k ≤ 2) and m (0 ≤ m ≤ 10).
For each test case, print the number of positive integers satisfying Ayla`s condition.