CF396A.On Number of Decompositions into Multipliers

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

You are given an integer mm as a product of integers a1,a2,... ana_{1},a_{2},...\ a_{n} . Your task is to find the number of distinct decompositions of number mm into the product of nn ordered positive integers.

Decomposition into nn products, given in the input, must also be considered in the answer. As the answer can be very large, print it modulo 10000000071000000007 (109+7)(10^{9}+7) .

输入格式

The first line contains positive integer nn ( 1<=n<=5001<=n<=500 ). The second line contains space-separated integers a1,a2,...,ana_{1},a_{2},...,a_{n} ( 1<=ai<=1091<=a_{i}<=10^{9} ).

输出格式

In a single line print a single number kk — the number of distinct decompositions of number mm into nn ordered multipliers modulo 10000000071000000007 (109+7)(10^{9}+7) .

输入输出样例

  • 输入#1

    1
    15
    

    输出#1

    1
    
  • 输入#2

    3
    1 1 2
    

    输出#2

    3
    
  • 输入#3

    2
    5 7
    

    输出#3

    4
    

说明/提示

In the second sample, the get a decomposition of number 2, you need any one number out of three to equal 2, and the rest to equal 1.

In the third sample, the possible ways of decomposing into ordered multipliers are [7,5], [5,7], [1,35], [35,1].

A decomposition of positive integer mm into nn ordered multipliers is a cortege of positive integers b=b1,b2,... bnb={b_{1},b_{2},...\ b_{n}} such that . Two decompositions bb and cc are considered different, if there exists index ii such that bicib_{i}≠c_{i} .

首页