#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
#define N 3000
int n, h, m;
long long f[61][90][N];
int main ( void ) {
int TA;
scanf("%d", &TA);
memset(f, 0, sizeof f);
for(int cur = 1; cur <= 80; cur++)
for(int rem = 0; rem <= 2500; rem++)
f[0][cur][rem] = 1;
for(int lvl = 1; lvl <= 60; lvl++)
for(int cur = 1; cur <= 80; cur++)
for(int rem_cubes = 0; rem_cubes < 2500; rem_cubes++) {
long long &ret = f[lvl][cur][rem_cubes];
int cand[] = {cur - 1, cur + 1};
for(int i = 0; i < 2; i++) {
int last = cand[i];
if(last > rem_cubes || last <= 0) continue;
ret += f[lvl - 1][last][rem_cubes - last];
}
}
while( TA-- ) {
scanf("%d %d %d", &n, &h, &m);
if( n > 2500 ) n = 2499;
printf("%lld\n", f[h - 1][m][n - m]);
}
}
I2luY2x1ZGUgPGNzdGRpbz4KI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGNzdHJpbmc+Cgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKI2RlZmluZSBOIDMwMDAKCmludCBuLCBoLCBtOwpsb25nIGxvbmcgZls2MV1bOTBdW05dOwoKaW50IG1haW4gKCB2b2lkICkgewogICAgaW50IFRBOwoKICAgIHNjYW5mKCIlZCIsICZUQSk7CgogICAgbWVtc2V0KGYsIDAsIHNpemVvZiBmKTsKCiAgICBmb3IoaW50IGN1ciA9IDE7IGN1ciA8PSA4MDsgY3VyKyspCiAgICAgICAgZm9yKGludCByZW0gPSAwOyByZW0gPD0gMjUwMDsgcmVtKyspCiAgICAgICAgICAgIGZbMF1bY3VyXVtyZW1dID0gMTsKCiAgICBmb3IoaW50IGx2bCA9IDE7IGx2bCA8PSA2MDsgbHZsKyspIAogICAgICAgIGZvcihpbnQgY3VyID0gMTsgY3VyIDw9IDgwOyBjdXIrKykKICAgICAgICAgICAgZm9yKGludCByZW1fY3ViZXMgPSAwOyByZW1fY3ViZXMgPCAyNTAwOyByZW1fY3ViZXMrKykgewogICAgICAgICAgICAgICAgbG9uZyBsb25nICZyZXQgPSBmW2x2bF1bY3VyXVtyZW1fY3ViZXNdOwoKICAgICAgICAgICAgICAgIGludCBjYW5kW10gPSB7Y3VyIC0gMSwgY3VyICsgMX07CgogICAgICAgICAgICAgICAgZm9yKGludCBpID0gMDsgaSA8IDI7IGkrKykgewogICAgICAgICAgICAgICAgICAgIGludCBsYXN0ID0gY2FuZFtpXTsKCiAgICAgICAgICAgICAgICAgICAgaWYobGFzdCA+IHJlbV9jdWJlcyB8fCBsYXN0IDw9IDApIGNvbnRpbnVlOwogICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgcmV0ICs9IGZbbHZsIC0gMV1bbGFzdF1bcmVtX2N1YmVzIC0gbGFzdF07CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KCgogICAgd2hpbGUoIFRBLS0gKSB7CiAgICAgICAgc2NhbmYoIiVkICVkICVkIiwgJm4sICZoLCAmbSk7CiAgICAgICAgaWYoIG4gPiAyNTAwICkgbiA9IDI0OTk7CiAgICAgICAgcHJpbnRmKCIlbGxkXG4iLCBmW2ggLSAxXVttXVtuIC0gbV0pOwogICAgfQp9Cg==