#P7438. [2017年杭电多校]Expectation Division

[2017年杭电多校]Expectation Division

Expectation Division

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 nn (n>1)(n > 1) as to replace it with an integer dd, one of factors of nn (1dn)(1 \leq d \leq n). You are given a positive integer nn and then we will ask you to determine the expectation number of times to utilize this type of operation if we want to change nn into 11 by operating again and again, assuming each possible dd in each operation has equal possibility to select. For the sake of calculation, nn and all its distinct prime factors p1,p2,,pmp_1, p_2, \cdots, p_m will be given, satisfying nn has mm distinct prime factors exactly.

Input

The input contains multiple test cases. For each test case: The first line contains two positive integers nn and mm which indicates mm is the number of distinct prime factors of nn, satisfying 2n10242 \leq n \leq 10^{24}. The second lines contains mm distinct prime numbers p1,p2,,pmp_1, p_2, \cdots, p_m, satisfying 2pi1062 \leq p_i \leq 10^6. About 21052 \cdot 10^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 #xx: yy " in one line (without quotes), where xx indicates the case number starting from 11 and yy 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 10910^{-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

Source

2017 Multi-University Training Contest - Team 1