#pragma GCC optimize("Ofast") #pragma GCC target("avx2") char*mmap(); #define RD(v) int v=0;{int _c;while(_c=*rp++-48,_c>=0)v=v*10+_c;} c[15]; d[100001]; main(){ char*rp=mmap(0l,1l<<28,1,2,0,0ll); RD(t); RD(n); for(int i=0;i=0;--j){ d[j+x]=d[j+x]>=d[j]+v?d[j+x]:d[j]+v; } }while(v>>=1); } { long y=0;int n=0,z=d[t]; while(++n,y=y<<8|0x30|z%10,z/=10); write(1,&y,n); } _exit(0); }