Divisor Product
Easy Accuracy: 0.0% Submissions: 1 Points: 2

Given a number N, find the product of all the divisors of N (including N).

 

Example 1:

Input : 
N = 6
Output:
36
Explanation:
Divisors of 6 : 1, 2, 3, 6
Product = 1*2*3*6 = 36 


Example 2:

Input : 
N = 5
Output:
5
Explanation:
Divisors of 5 : 1, 5
Product = 1*5 = 5 

 

Your Task:
You don't need to read input or print anything. Your task is to complete the function divisorProduct() which takes integer N as input parameter and returns the product. Since the products may be very large, compute the answer modulo (109+ 7).

 

Expected Time Complexity: O(sqrt(N))
Expected Auxiliary Space: O(1)

 

Constraints:
1 <= N <= 109

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.