import sys
sys.stdin = open("input.txt")
from itertools import combinations

T = int(input())
for tc in range(1, T+1):
    N, K = map(int, input().split())
    # 12까지의 원소 중  N개가 포함된 부분집합 
    subsets = combinations(range(1,13), N)
    
    # cnt = 0

    # for i in subsets:
    #     if sum(i) == K:
    #         cnt +=1 

    cnt = sum(1 for i in subsets if sum(i) == K)
    print('#{} {}'.format(tc, cnt))
4a6f3cb51c5d8ff702e81e816e69a5aadc0eb0d7
<mask token>

<mask token>
for tc in range(1, T + 1):
    N, K = map(int, input().split())
    subsets = combinations(range(1, 13), N)
    cnt = sum(1 for i in subsets if sum(i) == K)
    print('#{} {}'.format(tc, cnt))

<mask token>
sys.stdin = open('input.txt')
<mask token>
T = int(input())
for tc in range(1, T + 1):
    N, K = map(int, input().split())
    subsets = combinations(range(1, 13), N)
    cnt = sum(1 for i in subsets if sum(i) == K)
    print('#{} {}'.format(tc, cnt))

import sys
sys.stdin = open('input.txt')
from itertools import combinations
T = int(input())
for tc in range(1, T + 1):
    N, K = map(int, input().split())
    subsets = combinations(range(1, 13), N)
    cnt = sum(1 for i in subsets if sum(i) == K)
    print('#{} {}'.format(tc, cnt))

import sys
sys.stdin = open("input.txt")
from itertools import combinations

T = int(input())
for tc in range(1, T+1):
    N, K = map(int, input().split())
    # 12까지의 원소 중  N개가 포함된 부분집합 
    subsets = combinations(range(1,13), N)
    
    # cnt = 0

    # for i in subsets:
    #     if sum(i) == K:
    #         cnt +=1 

    cnt = sum(1 for i in subsets if sum(i) == K)
    print('#{} {}'.format(tc, cnt))