Problem Statement
You are given positive integers N and M. Here, it is guaranteed that NleqMleq2N.
Print the sum, modulo 200003 (a prime), of the following value over all sequences of positive integers S=(S1,S2,dots,SN) such that displaystylesumi=1NSi=M (notice the unusual modulo):
- displaystyleprodk=1Nmin(k,Sk).
Constraints
- 1leqNleq1012
- NleqMleq2N
- All values in the input are integers.
The input is given from Standard Input in the following format:
N M
Output
Print the answer as an integer.
3 5
Sample Output 1
14
There are six sequences S that satisfy the condition: $S=(1,1,3), S=(1,2,2), S=(1,3,1), S=(2,1,2), S=(2,2,1), S=(3,1,1)$.
The value displaystyleprodk=1Nmin(k,Sk) for each of those S is as follows.
- S=(1,1,3) : 1times1times3=3
- S=(1,2,2) : 1times2times2=4
- S=(1,3,1) : 1times2times1=2
- S=(2,1,2) : 1times1times2=2
- S=(2,2,1) : 1times2times1=2
- S=(3,1,1) : 1times1times1=1
Thus, you should print their sum: 14.
1126 2022
Sample Output 2
40166
Print the sum modulo 200003.
1000000000000 1500000000000
Sample Output 3
180030