OpenJudge

07:Count Sequences

总时间限制:
1000ms
内存限制:
262144kB
描述

Given three positive integers N, L and R, find the number of non-decreasing sequences of size at least 1and at most N, such that each element of the sequence lies between L and R, both inclusive.

Print the answer modulo 106+3.


输入
First line of input contains T, the number of the test cases.

Each of next T lines contains three space separated integers N, L and R.
输出
For each test case print the answer modulo 10^6+3 in a single line.
样例输入
2
1 4 5
2 4 5
样例输出
2
5
提示
1 ≤ T ≤ 100
L ≤ R

Subtask #1 (20 points): 1 ≤ N, L, R ≤ 100
Subtask #2 (30 points): 1 ≤ N, L, R ≤ 104
Subtask #3 (50 points): 1 ≤ N, L, R ≤ 109
来源
codechef April Challenge 2015
全局题号
10962
添加于
2017-08-26
提交次数
0
尝试人数
0
通过人数
0