Recursive problem: But what I didn't think of was. This unexpectedly is the legend of the answer to submit!! I was wrong two times.
Build Program:
#include <cstdio>inti,a[6]={1315, the,136,255,1384,16385};voidSearchints) { intt=0, r=s; if(s==1) printf ("2 (0)"); if(s==2) printf ("2"); if(s==3) printf ("(0)"); if(s>3){ for(; r;r>>=1) t++;t--;p rintf ("2 ("); Search (t);p rintf (")");if(s>1<<t) {printf ("+"); Search (S (1<<t));}} }intMain () {printf ("137="); Search (137); for(i=0;i<6; i++) {printf ("\n%d=", A[i]); search (A[i]);}}
and answer. (I think this thing can be pushed in all hands)
137=2(2(2)+2+2(0))+2(2+2(0))+2(0)1315=2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2(0))+2+2(0) the=2(2(2)+2)+2(2+2(0))+2(0)136=2(2(2)+2+2(0))+2(2+2(0))255=2(2(2)+2+2(0))+2(2(2)+2)+2(2(2)+2(0))+2(2(2))+2(2+2(0))+2(2)+2+2(0)1384=2(2(2+2(0))+2)+2(2(2+2(0)))+2(2(2)+2)+2(2(2)+2(0))+2(2+2(0))16385=2(2(2+2(0))+2(2)+2)+2(0)
Spoj problem 1688:a Very Easy problem!