Perfect divisors
Practice
3.2 (5 votes)
Modular arithmetic
Combinatorics
Number theory
Prime factorization
Basics of combinatorics
Algorithms
Modular exponentiation
Math
Problem
87% Success 2306 Attempts 30 Points 3s Time Limit 256MB Memory 1024 KB Max Code

You are given a positive integer \(X\) and your task is to find the summation of its perfect square divisors.
\(let \ X = {x_1}^{y_1} * {x_2}^{y_2} * {x_3}^{y_3} * .... * {x_n}^{y_n}.\)

Input format

The input is given in the following format

:\(n\\ x_1 \quad y_1\\ x_2 \quad y_2\\ x_3 \quad y_3\\ ...\\ x_n \quad y_n\)

Output format

Print one integer denoting the summation of the perfect square divisors of \(X\) modulo \(1e9 + 7\).

Constraints

 \(1 \leq x_i, y_i \leq 2\times {10^6} \\ 1 \leq n \leq 10^5\)

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
11 votes
Tags:
CombinatoricsData StructuresDynamic ProgrammingMath
Points:30
7 votes
Tags:
CombinatoricsBasics of CombinatoricsMathC++
Points:30
10 votes
Tags:
CombinatoricsMath