PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#GL0000189. Số ước của tích các số lớn (Divisors)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Số ước của tích các số lớn (Divisors)

Divisors

Source: Codeforces

Version: Phuoc Hung OJ Extended

Problem Statement

You are given nn positive integers a1,…,ana_1,\ldots,a_n. Each aia_i is guaranteed to have between 3 and 5 distinct positive divisors, inclusive. Let

P=a1a2⋯an.P=a_1a_2\cdots a_n.

Compute the number of positive divisors of PP modulo 998244353998244353. You receive the actual integers aia_i, not prime-factorization lines used internally for Codeforces hacks.

Input

The first line contains nn. Each of the next nn lines contains one integer aia_i.

Output

Print the number of positive divisors of PP modulo 998244353998244353.

Subtasks

The guarantee that each number has 3–5 divisors applies to every subtask.

  • Subtask 1 (20 points): 1≤n≤201 \le n \le 20, 1≤ai≤1000000001 \le a_i \le 100000000; every aia_i has 3–5 positive divisors.

  • Subtask 2 (30 points): 1≤n≤1201 \le n \le 120, 1≤ai≤10000000000001 \le a_i \le 1000000000000; every aia_i has 3–5 positive divisors.

  • Subtask 3 (50 points): 1≤n≤5001 \le n \le 500, 1≤ai≤20000000000000000001 \le a_i \le 2000000000000000000; every aia_i has 3–5 positive divisors.

Examples

Example 1

Input

3
9
15
143

Output

32

Explanation

The prime factorization of 9⋅15⋅1439\cdot15\cdot143 is 33⋅5⋅11⋅133^3\cdot5\cdot11\cdot13, giving (3+1)23=32(3+1)2^3=32 divisors.

Example 2

Input

1
7400840699802997

Output

4

Explanation

The input number is a product of distinct primes 8602812186028121 and 8602815786028157, so it has four divisors.

Example 3

Input

3
4
8
16

Output

10

Explanation

The product 4⋅8⋅16=294\cdot8\cdot16=2^9 has ten positive divisors.