MAIN75 - BST again

题意翻译

# 题目描述 求有多少棵大小为n的深度为h的二叉树。(树根深度为0,且左右子树有别) # 输入输出格式 ## 输入格式: 第一行一个整数T(1<=T<=10),表示数据组数。 以下T行,每行2个整数N和H(1<=N<=500,0<=H<=500)。 ## 输出格式: 共T行,对于每组数组每行输出一个整数表示答案(答案对1000000007取模) 感谢@白苏小公子喵 提供的翻译

题目描述

N nodes are labled with integers from 1 to N. Now these N nodes are inserted in a empty binary search tree. But the constraint is that

输入输出格式

输入格式


Input First line contains 1<=T<=10 the number of test cases. Follwomg T lines contains 2 integers each. N and H. 1<=N<=500, 0<=H<=500.

输出格式


For each test case print the required answer modulo 1000000007.

输入输出样例

输入样例 #1

1
2 1

输出样例 #1

2