#P4902. Nested Power Fraction Product
Nested Power Fraction Product
Nested Power Fraction Product
Given two integers A and B (with A ≤ B), compute the value of the expression:
$$\prod_{i=A}^{B}\prod_{j=1}^{i}\left(\frac{i}{j}\right)^{\lfloor\frac{i}{j}\rfloor} \pmod{19260817}$$
This expression is defined as a nested product where for each integer i from A to B, and for each integer j from 1 to i, you compute \(\left(\frac{i}{j}\right)^{\lfloor i/j \rfloor}\). Since the result is a rational number, your final answer should be computed in the modular form \(P \cdot Q^{-1} \pmod{19260817}\), where Q-1 is the modular inverse of Q modulo 19260817.
There will be T independent queries to process.
inputFormat
The first line contains an integer T, representing the number of test cases. Each of the following T lines contains two integers A and B (with A ≤ B), separated by spaces.
outputFormat
For each test case, output a single line containing the result of the expression computed modulo 19260817.
sample
1
1 1
1
</p>