#P7486. Obstacle Value of Dependency Products

    ID: 20681 Type: Default 1000ms 256MiB

Obstacle Value of Dependency Products

Obstacle Value of Dependency Products

虹 is a girl who enjoys fantasy. She defines the dependency value for two positive integers (i,j) as (\operatorname{lcm}(i,j)^{\operatorname{lcm}(i,j)}) (note the exponent is also (\operatorname{lcm}(i,j))). For any two positive integers (l) and (r) with (1 \le l \le r), she defines the obstacle value as the product of the dependency values of all pairs ((i,j)) satisfying (l \le i \le r) and (l \le j \le r).

Given a positive integer (n) and (t) queries, each containing two integers (l) and (r) with (1 \le l \le r \le n), you are to compute the obstacle value for the range ([l, r]) modulo (32465177).

inputFormat

The first line of input contains two integers (n) and (t) separated by a space. Each of the next (t) lines contains two integers (l) and (r) ((1 \le l \le r \le n)).

outputFormat

For each query, output the obstacle value modulo (32465177) on a separate line.

sample

3 2
1 1
1 2
1

64

</p>