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]; var dp4=new int[n+1]; var li=new List[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]+j){ dp1[i]=dp1[i-j*j]+j; dp4[i]=dp4[i-j*j]+1; dp2[i]=i-j*j; dp3[i]=Fu(dp3[i-j*j],j); li[i]=new List(); li[i].Add(i-j*j); } else if(dp1[i]==dp1[i-j*j]+j){ dp4[i]=dp4[i-j*j]+1; dp2[i]=i-j*j; dp3[i]=Fu(dp3[i-j*j],j); li[i].Add(i-j*j); } } } var d=new int[50]; StringBuilder ans=new StringBuilder("1"); Fu2(n,0); void Fu2(int p,int g){ if(p==0){ var h=d.Skip(0).Take(g).ToArray(); Array.Sort(h,(u,v)=>v==Fu(v,u)?1:-1); var 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