#include<iostream>
#include<cstdio>
using namespace std;
int memo[101][101][2];
int n,k;
void init()
{
for(int i=0;i<=n;i++)
for(int j=0;j<=n;j++)
for(int k=0;k<2;k++)
memo[i][j][k]=-1;
}
int dp(int index,int current_k,int prev_bit)
{
if(index==n)
return current_k==k;
int &ret=memo[index][current_k][prev_bit];
if(ret==-1)
{
ret=dp(index+1,current_k+prev_bit,1);
ret+=dp(index+1,current_k,0);
}
return ret;
}
int main()
{
int test;
int data_set_number;
scanf("%d",&test);
while(test--)
{
scanf("%d %d %d",&data_set_number,&n,&k);
init();
int ans=dp(0,0,0);
printf("%d %d\n",data_set_number,ans);
}
return 0;
}
I2luY2x1ZGU8aW9zdHJlYW0+CiNpbmNsdWRlPGNzdGRpbz4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKaW50IG1lbW9bMTAxXVsxMDFdWzJdOwppbnQgbixrOwp2b2lkIGluaXQoKQp7CiAgICBmb3IoaW50IGk9MDtpPD1uO2krKykKICAgICAgICBmb3IoaW50IGo9MDtqPD1uO2orKykKICAgICAgICAgICAgZm9yKGludCBrPTA7azwyO2srKykKICAgICAgICAgICAgICAgIG1lbW9baV1bal1ba109LTE7Cn0KaW50IGRwKGludCBpbmRleCxpbnQgY3VycmVudF9rLGludCBwcmV2X2JpdCkKewogICAgaWYoaW5kZXg9PW4pCiAgICAgICAgcmV0dXJuIGN1cnJlbnRfaz09azsKICAgIGludCAmcmV0PW1lbW9baW5kZXhdW2N1cnJlbnRfa11bcHJldl9iaXRdOwogICAgaWYocmV0PT0tMSkKICAgIHsKCiAgICAgICAgcmV0PWRwKGluZGV4KzEsY3VycmVudF9rK3ByZXZfYml0LDEpOwogICAgICAgIHJldCs9ZHAoaW5kZXgrMSxjdXJyZW50X2ssMCk7CiAgICB9CiAgICByZXR1cm4gcmV0Owp9CmludCBtYWluKCkKewogICAgaW50IHRlc3Q7CiAgICBpbnQgZGF0YV9zZXRfbnVtYmVyOwogICAgc2NhbmYoIiVkIiwmdGVzdCk7CiAgICB3aGlsZSh0ZXN0LS0pCiAgICB7CiAgICAgICAgc2NhbmYoIiVkICVkICVkIiwmZGF0YV9zZXRfbnVtYmVyLCZuLCZrKTsKICAgICAgICBpbml0KCk7CiAgICAgICAgaW50IGFucz1kcCgwLDAsMCk7CiAgICAgICAgIHByaW50ZigiJWQgJWRcbiIsZGF0YV9zZXRfbnVtYmVyLGFucyk7CiAgICB9CnJldHVybiAwOwp9Cg==