using System; using System.Collections.Generic; using System.Collections; using System.Collections.Specialized; using System.Linq; using System.Text; using System.IO; using System.Reflection; using static System.Math; using System.Numerics; //using nint=System.Int32; static class Program{ const int mod=(int)1e9+7; const double eps=1e-11; static void Main(){ Sc sc=new Sc(); var n=sc.I; var dp1=new int[n+1]; var dp2=new int[n+1]; var dp3=new int[n+1]; for(int i = 1;i<=n;i++) { dp1[i]=int.MaxValue; for(int j = 1;j*j<=i;j++) { if(dp1[i]>dp1[i-j*j]+1){ dp1[i]=dp1[i-j*j]+1; dp2[i]=i-j*j; dp3[i]=Fu(dp3[i-j*j],j); } else if(dp1[i]==dp1[i-j*j]+1&&dp3[i]!=Fu(Fu(dp3[i-j*j],j),dp3[i])){ dp2[i]=i-j*j; dp3[i]=Fu(dp3[i-j*j],j); } } } int p=n; var h=new int[dp1[p]]; for(int i = 0;p!=0;i++) { h[i]=(int)Sqrt(p-dp2[p]); p=dp2[p]; } Array.Sort(h,(u,v)=>v==Fu(v,u)?1:-1); StringBuilder sb=new StringBuilder(); for(int i = 0,k=1;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i(int n,Func f){var a=new T[n];for(int i=0;i