The Lovers
Difficulty: Hard

**Description:**

Once upon a time there was a man who had multiple girlfriends. Each girl thought she was the only one in the man's heart but this was not true. He was cheating on all of them.  

**N** houses were situated in a row and each house had exactly one of his girlfriends living there.  

One day he wanted to visit **K** of his girlfriends but he then realized that he couldn't visit two consecutive houses. That would be too dangerous.  

How many different ways did the man have for visiting his girlfriends?   

The ordering of houses does not matter. i.e, how many different combinations of houses could the man consider.  


**Input Format**

The first line contains an integer **T**  - the number of test cases. 
Next follow **T** lines, each containing two space separated integers, **N** and **K**.  

**Constraints**  

 
    1 <= T <= 10  
    1 <= N <= 10^15   
    1 <= K <= 10^15    
 


**Output format**

The output must contain **T** lines, each containing **one** integer - the number of ways the man can visit his girlfriends. Output the answer **modulo 100003**.


**Sample input**
    
    4
    7 3
    8 5
    10 5
    100000 555


**Sample output**

    10
    0
    6
    14258
    
**Hint**

For example, in the first test case, there are 7 houses, and the lover will visit 3 of them without visiting two in consecutive positions. The 10 ways are these:

	X0X0X00
	X0X00X0
	X0X000X
	X00X0X0
	X00X00X
	X000X0X
	0X0X0X0
	0X0X00X
	0X00X0X
	00X0X0X

Input Format:

Output Format:

Sample Input:

Sample Output:

Python 3 starter code:


Reference solution (Python):
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;


    public class Main {
	static int T;
	static long N, K;
	static  long MOD = 100003;
	static long factorial[];
	
	public static long POW(long a, long b){
		if(b == 0) return 1;
		if(b == 1) return a % MOD;
		if(b % 2 == 1) return ((a%MOD) * POW(a, b-1)) % MOD;
		long k = POW(a, b/2);
		return (k*k)%MOD;
	}
			
	public static long binomial(int n, int k) {
		if( n < k) return 0;
		long up = factorial[n];
		long down = (factorial[n - k] * factorial[k]) % MOD;		
		long inv = POW(down, MOD - 2);		
		return (up * inv) % MOD;
	}
	
	public static long lucas(long n, long k) {
		return ( binomial((int) (n/MOD/MOD%MOD),(int) (k/MOD/MOD%MOD)) * binomial((int) (n/MOD%MOD),(int) (k/MOD%MOD)) * binomial((int) (n%MOD),(int) (k%MOD)) ) % MOD;
	}
			
	public static void main(String[] args) throws NumberFormatException, IOException {
		InputStreamReader sr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(sr);		
		
		T = Integer.parseInt(br.readLine());
		String cad[];
		
		factorial = new long[100015];
		factorial[0] = 1;
		factorial[1] = 1;
		
		for (int i = 2; i < 100010; i++) 
			factorial[i] = (((long) i) * factorial[i-1]) % MOD;		
		
		
		while(T--> 0) {
			cad = br.readLine().split(" ");
			N = Long.parseLong(cad[0]);
			K = Long.parseLong(cad[1]);
			
			if(N - K + 1 < K) System.out.println(0); else			
			System.out.println(lucas(N - K + 1, K));
		}			
	}

}