#include #define MAX 42 int pole[MAX]; char s[MAX]; char s1[MAX]; char s2[MAX]; int i,j,a,b,c; int r,l,l1,l2,z; void gen(){ pole[0]=1; pole[1]=2; for(i=2;i=0){ if (s[i]=='1') r += pole[l-i]; i--; } return r; } void cisti(){ int i; for (i=0;il2) l = l1; i = l+2; while (pole[i]>z) i--; l=i; while (i>=0){ if (pole[i]<=z){ z-=pole[i]; s[l-i] = '1'; } else s[l-i] = '0'; i--; } for(i=0;i