1. 程式人生 > >HDU 多校1.5

HDU 多校1.5

family cto desc utili left where ane respond factors

Expectation Division

Time Limit: 6000/3000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)
Total Submission(s): 0 Accepted Submission(s): 0
Special Judge


Problem Description To be frank with you, this problem is a classic problem of tremendous magnitude which may increase the difficulty of this problem.

We define a type of operation concerning a positive integer n技術分享 (n>1)技術分享 as to replace it with an integer d技術分享 , one of factors of n技術分享 (1dn)技術分享 .

You are given a positive integer n技術分享 and then we will ask you to determine the expectation number of times to utilize this type of operation if we want to change n技術分享
into 1技術分享 by operating again and again, assuming each possible d技術分享 in each operation has equal possibility to select.

For the sake of calculation, n技術分享 and all its distinct prime factors p技術分享1技術分享,p技術分享2技術分享,?,p技術分享m技術分享技術分享 will be given, satisfying n技術分享 has m技術分享 distinct prime factors exactly.

Input The input contains multiple test cases.

For each test case:

The first line contains two positive integers n技術分享 and m技術分享 which indicates m技術分享 is the number of distinct prime factors of n技術分享 , satisfying 2n10技術分享24技術分享技術分享 .

The second lines contains m技術分享 distinct prime numbers p技術分享1技術分享,p技術分享2技術分享,?,p技術分享m技術分享技術分享 , satisfying 2p技術分享i技術分享10技術分享6技術分享技術分享 .

About 210技術分享5技術分享技術分享 test cases in total.

Warm Tips for C/C++: __int128_t is available here but standard solutions of this problem do not use this compiler-dependent data type.

Output For each test case, output "Case #x技術分享 : y技術分享 " in one line (without quotes), where x技術分享 indicates the case number starting from 1技術分享 and y技術分享 denotes the expectation number of times to utilize this type of operation of corresponding case. Your answer will be considered correct if its absolute or relative error won‘t exceed 10技術分享9技術分享技術分享 .

Sample Input 2 1 2 4 1 2 6 2 2 3 8 1 2 10 2 2 5 12 2 2 3

Sample Output Case #1: 2.0000000000 Case #2: 2.5000000000 Case #3: 2.6666666667 Case #4: 2.8333333333 Case #5: 2.6666666667 Case #6: 3.0333333333

HDU 多校1.5