Recover Factorial

Factorial numbers are expressible as the multiplication of zero or more prime factors. For example 4! (Factorial of 4) can be expressed as follows: 4! = 2 × 2 × 2 × 3 (total number of prime factor is 4) Given N, the number of prime factors in X! (Factorial of X), you have to find the minimum possible value of X. Input There may be at most 1000 test cases. Each test case consists of one non-negative integer N ≤ 10000001 in each line. A negative integer marks the end of input, which should not be processed by your program. Output For every test case except last one print either ‘Case #: X!’ if solution exist or ‘Case #: Not possible.’ if no solution exist in each line (without the quotes). Here # represents serial of test case starting from 1. Look at sample output for details. Sample Input 4 240 241 -1 Sample Output Case 1: 4! Case 2: 101! Case 3: Not possible