Modulo 11
Easy
Execution time limit is 3 seconds
Runtime memory usage limit is 2,048 megabytes
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.
Input
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).
Output
For each test case, print the number of positive integers satisfying Ayla`s condition.
Examples
Input #1
Answer #1
Submissions 349
Acceptance rate 17%