#include <cstdio>
#include <cmath>
typedef long long LL;
struct node
{
int x;
int cnt;
}fac[110];
int main()
{
LL fn;
int ansF,ansLen=0;
scanf("%lld",&fn);
int i=2,j = 2;
int t = sqrt(fn);
while(1)
{
LL temp = 1;
for(i = j;i<fn;i++)
{
temp *=i;
if(fn%temp!=0)
{
break;
}
}
if(ansLen < i-j)
{
ansF = j;
ansLen = i - j;
}
j=j+1;
if(j>t)
break;
// printf("%d %d\n",ansF,ansLen);
}
if(ansLen == 0)
printf("1\n%lld",fn);
else{
printf("%d\n",ansLen);
for(int z = 0;z<ansLen;z++)
{
printf("%d",ansF++);
if(z!=ansLen - 1)
printf("*");
}
}
return 0;
}
5.5 1096 Consecutive Factors (20 分)(***)
最新推荐文章于 2021-02-18 16:30:32 发布