w;main(z){for(;~scanf(z="%d\n",&w);)printf(z,r(w,1,0));}r(v,i,s){for(;i++<v+1;)s=v%i||s>(w=r(v/i,1,0))?s:w;for(;v;v/=10)s+=v%10;return s;}
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page