SOLVE

LATER

Divisor Queries.

Problem

Editorial

Analytics

Consider the Function:

$$ F(X) $$ = Number of Divisors of Integer $$'X'$$

You have been given an array consisting of $$N$$ integers and $$M$$ queries .There can be only 1 type of query i.e :

$$query(l,r)$$ : You need to find product of all number in the range from $$l$$ to $$r$$ inclusive and then output the result of function $$F(X)$$ mod $$10^9 +7 $$ for that product.

**Input Format**:

The first line contains 2 integers $$N$$ and $$M$$ denoting the number of array elements and the number of queries The next line contains $$N$$ numbers denoting the elements of the array .

Each of the next M lines contains 2 integers $$l$$ and $$r$$ for whom the query needs to be answered.

**Output Format**:

For each query you need to print a single number denoting the answer to that query mod $$10^9 +7$$

**Constraints**:

$$ 1\le N \le 5*10^5 $$

$$1 \le M \le 4*10^5 $$

$$ 1 \le l \le r \le N $$

$$ 1 \le a[i] \le 10 $$

**Note**: Each element of the array shall not have a value greater than 10.

Explanation

For the 1st query, the product is 2 , F(2)=2. For the second query , product=720 , F(720)=30.

Time Limit:
1.0 sec(s)
for each input file.

Memory Limit:
256 MB

Source Limit:
1024 KB

Marking Scheme:
Marks are awarded when all the testcases pass.

Allowed Languages:
C,
C++,
C++14,
Clojure,
C#,
D,
Erlang,
F#,
Go,
Groovy,
Haskell,
Java,
Java 8,
JavaScript(Rhino),
JavaScript(Node.js),
Julia,
Lisp,
Lisp (SBCL),
Lua,
Objective-C,
OCaml,
Octave,
Pascal,
Perl,
PHP,
Python,
Python 3,
R(RScript),
Racket,
Ruby,
Rust,
Scala,
Swift,
Visual Basic,
Kotlin

Initializing Code Editor...

OTHER PROBLEMS OF THIS CHALLENGE

{"66ee265": "/pagelets/recommended-problems/algorithm/divisor-queries-37/", "66ee1fc": "/pagelets/show-submission/algorithm/divisor-queries-37/", "66ee223": "/pagelets/suggested-problems/algorithm/divisor-queries-37/", "66ee23b": "/pagelets/problem-author-tester/algorithm/divisor-queries-37/", "66ee251": "/pagelets/problems-hint/algorithm/divisor-queries-37/"}

{}

realtime.hackerearth.com

80

c8fcfcdf2150d50d7cf53b5be0dd64d8059a5c34

58a29e5cae2309f04b28

/realtime/pusher/auth/