Perfect divisors

3.2

5 votes
Modular arithmetic, Combinatorics, Number theory, Prime Factorization, Basics of Combinatorics, Algorithms, Modular exponentiation, Math
Problem

You are given a positive integer X and your task is to find the summation of its perfect square divisors.
let X=x1y1x2y2x3y3....xnyn.

Input format

The input is given in the following format

:nx1y1x2y2x3y3...xnyn

Output format

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

Constraints

 1xi,yi2×1061n105

Sample Input
2
2 2
3 1
Sample Output
5
Time Limit: 3
Memory Limit: 256
Source Limit:
Explanation

the sampe input corresponds to X = 2^2 * 3^1 = 12, which has these divisors : 1, 2, 3, 4, 6, 12.
Among these divisors these are pefect square : 1, 4, so the answer is 1 + 4 = 5

Editor Image

?