#GL0000176. Phân tích số lượng, tổng và tích các ước (Divisor Analysis)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Phân tích số lượng, tổng và tích các ước (Divisor Analysis)
Divisor Analysis
Source: CSES
Version: Phuoc Hung OJ Extended
Problem Statement
A positive integer can be too large to represent directly. It is therefore provided through its prime factorization:
where all are distinct primes and all are positive integers.
Find (1) the number of positive divisors of , (2) the sum of its positive divisors, and (3) the product of its positive divisors. For , its divisors are , giving , and .
Print the three results modulo .
Input
The first line contains , the number of distinct prime factors. Each of the next lines contains two integers ; every is prime and the primes are distinct.
Output
Print three integers on one line: the number, sum and product of divisors, each modulo .
Subtasks
- Subtask 1 (20 points): $1 \le n \le 10,\quad 2 \le p_i \le 100,\quad 1 \le e_i \le 6$.
- Subtask 2 (30 points): $1 \le n \le 10^3,\quad 2 \le p_i \le 10^5,\quad 1 \le e_i \le 10^6$.
- Subtask 3 (50 points): $1 \le n \le 10^5,\quad 2 \le p_i \le 10^6,\quad 1 \le e_i \le 10^9$.
Examples
Example 1
Input
2
2 2
3 1
Output
6 28 1728
Explanation
has divisors , whose count, sum and product are , and .