#include<iostream>
#include<math.h>
using namespace std;
typedef long long ll;
int main()
{
ll n,ansI=2,ansLen=0,cnt,temp;
cin>>n;
ll sqr=(int)sqrt(1.0*n);
for(ll i=2;i<=sqr;i++){
temp=n;
if(temp%i!=0) continue;
ll step=i;
cnt=0;
while(1){
if(temp%step==0){
cnt++;
temp/=step;
step++;
}else{
if(cnt>ansLen){
ansI=i;
ansLen=cnt;
}
break;
}
}
}
if(ansLen==0){
ansI=n;
ansLen=1;
}
printf("%lld\n",ansLen);
for(int i=ansI;i<ansI+ansLen;i++){
if(i==ansI) printf("%lld",i);
else printf("*%lld",i);
}
return 0;
}
PAT A 1096 Consecutive Factors
最新推荐文章于 2021-03-09 15:35:14 发布