#include <stdio.h>
#include <stdlib.h>
#include<math.h>
int main(int argc, char *argv[])
{
long int b[12],out[5],i,j,a,t,ct=2,p,q,sum,m=0,flag,pra=1,x,hui,u;
for(i=0;i<12;i++)
for(i=0;i<t;i++)
{
hui=2;
ct=0;
pra=1;
u=0;
if(p==4096)
else
{
if(p>4096)
{
u=p/2048;
ct=ct+u;
p=p%2048;
}
for(j=0;j<=12;j++)
{
if(p==b[j])
{
hui=1;
}
}
if(hui==1)
flag=1;
else
{
for(j=0;j<=12;j++)
{
if(p>b[j])
flag=1;
else
{
a=j-1;
j=13;
}
}
x=a-1;
ct=ct+2;
while(pra==1)
{
sum=b[a]+b[x];
if(sum==p)
pra=2;
else
{
if(sum>p)
x=x-1;
else
{
ct++;
b[a]=b[a]+b[x];
x=x-1;
}
}
}
}
}
}
//scanf("%d",&q);
return 0;
}
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdGRsaWIuaD4KI2luY2x1ZGU8bWF0aC5oPgogCmludCBtYWluKGludCBhcmdjLCBjaGFyICphcmd2W10pCnsKIAogIGxvbmcgaW50IGJbMTJdLG91dFs1XSxpLGosYSx0LGN0PTIscCxxLHN1bSxtPTAsZmxhZyxwcmE9MSx4LGh1aSx1OwogIGZvcihpPTA7aTwxMjtpKyspCiAgYltpXT1wb3coMixpKTsKICBzY2FuZigiJWxkIiwmdCk7CiAgZm9yKGk9MDtpPHQ7aSsrKQogIHsKICAgICAgICBodWk9MjsKICAgICAgICBjdD0wOwogICAgICAgIHByYT0xOwogICAgICAgIHU9MDsKICAgICAgICBzY2FuZigiJWxkIiwmcCk7CiAgICAgICAgaWYocD09NDA5NikKICAgICAgICAgICAgcHJpbnRmKCIyXG4iKTsKICAgICAgICAgICAgZWxzZQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBpZihwPjQwOTYpCiAgICAgICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAgICAgdT1wLzIwNDg7CiAgICAgICAgICAgICAgICAgICAgY3Q9Y3QrdTsKICAgICAgICAgICAgICAgICAgICBwPXAlMjA0ODsKICAgICAgICAgICAgICAgIH0KICAgICAgICBmb3Ioaj0wO2o8PTEyO2orKykKICAgICAgICB7CiAgICAgICAgICAgIGlmKHA9PWJbal0pCiAgICAgICAgICAgIHsKICAgICAgICAgICAgcHJpbnRmKCIlbGRcbiIsY3QrMSk7CiAgICAgICAgICAgIGh1aT0xOwogICAgICAgIH0KICAgIH0KIAogICAgICAgIGlmKGh1aT09MSkKICAgICAgICBmbGFnPTE7CiAgICAgICAgZWxzZQogICAgICAgIHsKIAogICAgICAgIGZvcihqPTA7ajw9MTI7aisrKQogICAgICAgIHsKIAogCiAgICAgICAgICAgIGlmKHA+YltqXSkKICAgICAgICAgICAgZmxhZz0xOwogICAgICAgICAgICBlbHNlCiAgICAgICAgICAgIHsKICAgICAgICAgICAgYT1qLTE7CiAgICAgICAgICAgIGo9MTM7CiAgICAgICAgfQogCiAgICB9CiAgICB4PWEtMTsKICAgIGN0PWN0KzI7CiAgICB3aGlsZShwcmE9PTEpCiAgICB7CiAKICAgICAgICBzdW09YlthXStiW3hdOwogICAgICAgIGlmKHN1bT09cCkKICAgICAgICBwcmE9MjsKICAgICAgICBlbHNlCiAgICAgICAgewogCiAgICBpZihzdW0+cCkKICAgIHg9eC0xOwogICAgZWxzZQogICAgewogICAgICAgIGN0Kys7CiAgICAgICAgYlthXT1iW2FdK2JbeF07CiAgICAgICAgeD14LTE7CiAgICB9Cn0KfQogCnByaW50ZigiJWxkXG4iLGN0KTsKfQp9Cn0KLy9zY2FuZigiJWQiLCZxKTsKcmV0dXJuIDA7Cn0K