1300: HEX
内存限制:128 MB
时间限制:4.000 S
评测方式:文本比较
命题人:
提交:26
解决:9
题目描述
On a plain of hexagonal grid, we define a step as one move from the current grid to the lower/lower-left/lower-right grid. For example, we can move from (1,1) to (2,1), (2,2) or (3,2).
In the following graph we give a demonstrate of how this coordinate system works.
Your task is to calculate how many possible ways can you get to grid(A,B) from gird(1,1), where A and B represent the grid is on the B-th position of the A-th line.
输入
For each test case, two integers A (1<=A<=100000) and B (1<=B<=A) are given in a line, process till the end of file, the number of test cases is around 1200.
输出
For
each case output one integer in a line, the number of ways to get to the
destination MOD 1000000007.
样例输入 复制
1 1
3 2
100000 100000
样例输出 复制
1
3
1