Files
PAT/html/a1059.html
T

20 lines
1006 B
HTML

<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<h1>1059. Prime Factors (25)</h1>
<div id="problemContent">
<p>Given any positive integer N, you are supposed to find all of its prime factors, and write them in the format N = p<sub>1</sub>^k<sub>1</sub> * p<sub>2</sub>^k<sub>2</sub> *…*p<sub>m</sub>^k<sub>m</sub>.</p>
<p><b>
Input Specification:
</b></p>
<p>Each input file contains one test case which gives a positive integer N in the range of long int.</p>
<p><b>
Output Specification:
</b></p>
<p>Factor N in the format N = p<sub>1</sub>^k<sub>1</sub> * p<sub>2</sub>^k<sub>2</sub> *…*p<sub>m</sub>^k<sub>m</sub>, where p<sub>i</sub>'s are prime factors of N in increasing order, and the exponent k<sub>i</sub> is the number of p<sub>i</sub> -- hence when there is only one p<sub>i</sub>, k<sub>i</sub> is 1 and must NOT be printed out.</p>
<b>Sample Input:</b><pre>
97532468
</pre>
<b>Sample Output:</b><pre>
97532468=2^2*11*17*101*1291
</pre>
</div>