Code Festival C Div and Add by mitchs

f(n,d,m){for(m=d=1;d<n;)m=fmax(m,f(d-n%d++*n)+n%10+n/10-n/100*9);return m;}main(n){for(;gets(&n);printf("%u\n",f(atoi())));}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page