Nikitosh and Saurontetrahedron

All submissions for this problem are available.
Read problems statements in Mandarin Chinese, Russian and Vietnamese as well.
A dark tetrahedron's size is said to be N if each of its edges consists of N segments.
To destroy a dark tetrahedron of size N, you have to erase at least N segments (you can't destroy a dark tetrahedron partially: the tetrahedron uses dark magic to selfcure if you erase less than N segments, and so it's the same as not erasing any segment). Also, to protect yourself from the tetraheldral curse, you must ensure that each vertex of a tetrahedron needs to have at least 2 incident segments. Note that a dark tetrahedron has 4 vertices, just like regular tetrahedrons.
A Saurontetrahedron of size N with resistance K is made of N dark tetrahedrons with sizes 1, 2, ... , N. To destroy a Saurontetrahedron, you have to destroy at least K of its constituent tetrahedrons.
Wizard Nikitosh needs to detroy a Saurontetahedron of size N with resistance K and he wants to know how many ways to destroy it are there. Since Nikitosh's creative juices only flow for wizardry, he needs your mathematical talent to solve this problem.
You also need to follow the wizard's order to output the answer modulo 10^{5}+3.
Input
The first line of input contains an integer T denoting the number of test cases. The description of T test cases follows.
For each test case, a single line contains two integers, N and K, representing the size of the super tetrahedron and its resistance.
Output
For each test case, output a single line. It must contain the number of ways to destroy a super tetrahedron of size N with resistance K (modulo 10^{5}+3).
Constraints
 1 ≤ T ≤ 5
 1 ≤ N ≤ 6*10^{4}
 1 ≤ K ≤ N
Subtasks
 Subtask #1 (20 points): 1 ≤ N ≤ 10^{3}
 Subtask #2 (80 points): 1 ≤ N ≤ 6*10^{4}
Example
Input: 2 1 1 2 1 Output: 9 2439
Author:  rebryk 
Tester:  iscsi 
Editorial  http://discuss.codechef.com/problems/REBTET 
Tags  binomial, fourier, karatsuba, mediumhard, nov15, rebryk 
Date Added:  24042015 
Time Limit:  3 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA, PYTH, PYTH 3.5, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, CLOJ, FS 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 