题目大意:给定一个数,要找到因子中连续长度最大的一个串,但是这些数乘积还是要是因子.(这个条件题目中好像看不出来但是样例里有)
#include<bits/stdc++.h>
using namespace std;#define debug puts("YES");
#define rep(x,y,z) for(int (x)=(y);(x)<(z);(x)++)
#define ll long long
#define ull unsigned long long#define lrt int l,int r,int rt
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define root l,r,rt
#define mst(a,b) memset((a),(b),sizeof(a))
#define pii pair<int,int>
#define piii pair<int,pii>
#define fi first
#define se second
#define mk(x,y) make_pair(x,y)#define base 2333
const int mod=1e9+7;
const int maxn=1e5+10;
const int ub=1e6;
ll powmod(ll x,ll y){ll t; for(t=1;y;y>>=1,x=x*x%mod) if(y&1) t=t*x%mod; return t;}
ll gcd(ll x,ll y){if(y==0) return x;return gcd(y,x%y);
}
int n,ans[maxn];
vector<int> g,ret;
int main(){cin>>n;for(int i=1;i*i<=n;i++) if(n%i==0){int x=i,y=n/i;if(x!=1) g.push_back(x);if(x!=y&&y!=1) g.push_back(y);}sort(g.begin(),g.end());ans[0]=1;rep(i,1,g.size()){if(g[i]-g[i-1]==1) ans[i]=ans[i-1]+1;else ans[i]=1;}int maxv=0;rep(i,0,g.size()){int j,tmp=n;for(j=i;j>=i-ans[i]+1;j--){if(tmp%g[j]==0) tmp/=g[j];else break;}j++;if(i-j+1>ret.size()){ret.clear();rep(k,j,i+1) ret.push_back(g[k]);}}cout<<ret.size()<<"\n";rep(i,0,ret.size()-1) cout<<ret[i]<<"*";cout<<ret[ret.size()-1]<<"\n";return 0;
}