eolymp
bolt
Try our new interface for solving problems
Problems

Minimum Sum LCM

Minimum Sum LCM

\includegraphics{https://static.e-olymp.com/content/58/58546ccbdc99384faf254f827b570c9e0e1fe325.jpg} \textbf{LCM} (Least Common Multiple) of a set of integers is defined as the minimum number, which is a multiple of all integers in that set. It is interesting to note that any positive integer can be expressed as the \textbf{LCM} of a set of positive integers. For example \textbf{12} can be expressed as the \textbf{LCM} of \textbf{1}, \textbf{12} or \textbf{12}, \textbf{12} or \textbf{3}, \textbf{4} or \textbf{4}, \textbf{6} or \textbf{1}, \textbf{2}, \textbf{3}, \textbf{4} etc. In this problem, you will be given a positive integer \textbf{n}. You have to find a set of at least two positive integers whose \textbf{LCM} is \textbf{n}. As there exists an infinite number of such sequences, you have to pick the sequence whose summation of elements is minimum. We will be quite happy if you just print the summation of the elements of this set. So, for \textbf{n} = \textbf{12}, you should print \textbf{4 + 3 = 7} as \textbf{LCM} of \textbf{4} and \textbf{3} is \textbf{12} and \textbf{7} is the minimum possible summation. \InputFile Input contains at most \textbf{100} test cases. Each test case consists of a positive integer \textbf{n} (\textbf{1}\textit{ ≤ }\textbf{n}\textit{ ≤ }\textbf{2^31} -- \textbf{1}). Input is terminated by a case where \textbf{n} = \textbf{0}. This case should not be processed. There can be at most \textbf{100} test cases. \OutputFile Output of each test case should consist of a line starting with "\textbf{Case #:} " where \textbf{#} is the test case number. It should be followed by the summation as specified in the problem statement. Look at the output for sample input for details.
Time limit 1 second
Memory limit 64 MiB
Input example #1
12
10
5
0
Output example #1
Case 1: 7
Case 2: 7
Case 3: 6