2022 Azerbaijan Round 1, 8-9-10-11 classes
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 and giving 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.
2 1 0 2 0