ANURAGS NEW STRATEGY OF MULTIPLICATION

All submissions for this problem are available.
Thank you for helping Chef Anurag in his multiplication assignment. He is much better in
multiplication now and is learning division now. So his teacher gave him another multiplication test.
This one is a bit difficult for him. In this assignment, he is given 'n' numbers in an array (1based
indexing). He is also given two integers 'i' and 'j'. His teacher asked him to multiply all numbers
between index 'i' and 'j' both inclusive. As if this was not enough, his teacher added another thing to
it. He also needs to print the number of factors of the number obtained after the multiplication. (see
explanation for clarification)
Input
The first line of the input is a single integer 'T' denoting the number of test cases. Each test case starts with a single integer 'n' number of numbers. Next line contains 'n' space separated integers 'num' denoting the entries in the array. Next line contains a single integer 'q' denoting number of queries. Next 'q' lines contain two integers 'i' and 'j' denoting the interval in which we need the multiplication.
Output
For each query, print on a single line two integers, first is the result of the multiplication and
second is the number of factors of the result of the multiplication. Since the results can be large,
print both of them modulo 1000000007 (10^9+7).
Constraints
 1 <= T <= 10
 1 <= n <= 10000 (10^4)
 1 <= num <= 100
 1 <= i, j <= n
 1 <= q <= 10000 (10^4)
Example
Input: 1 5 1 2 3 4 5 2 2 3 1 5 Output: 6 4 120 16
Explanation :
Case #1 :
The numbers in range [2,3] are 2 and 3. Their multiplication is 2*3 = 6. The factors of 6 are
1,2,3 and 6.
Case #2 :
The numbers in range [1,5] are 1,2,3,4 and 5. Their multiplication is 1*2*3*4*5 = 120. The
factors of 120 are 1,2,3,4,5,6,8,10,12,15,20,24,30,40,60 and 120
Author:  nikuamit 
Editorial  http://discuss.codechef.com/problems/BIGOF05 
Tags  nikuamit 
Date Added:  4042015 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14, JAVA 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 