#nt602. 组合数取模4
组合数取模4
Binomial Coefficient Modulo 4
Problem Description
You are given a modulus . Answer queries; for each query output the value of .
Input Format
The first line contains two integers .
The following lines each contain two integers .
Output Format
For each query, output one line: the answer.
Sample Input
10000 3
5 2
50 20
50000000 20000000
Sample Output
10
3960
8800
Constraints
For all data, , , .