5167 - GESP:2023-9月等级5-T1-因素分解
Time Limit : 1 秒
Memory Limit : 128 MB
每个正整数都可以分解成素数的乘积,例如:
6=2 * 3
20=2^2 * 5
现在,给定一个正整数N ,请按要求输出它的因数分解式。
Input
输入第一行,包含一个正整数N 。约定2<=N<=10^12
Output
输出一行,为N的因数分解式。要求按质因数由小到大排列,乘号用星号*表示,且左右各空一格。当且仅当一个素数出现多次时,将它们合并为指数形式,用上箭头^表示,且左右不空格
Examples
Input
6
Output
2 * 3
Input
20
Output
2^2 * 5
Input
23
Output
23