/*
CODECHEF
PROBLEM CODE : PARALLEL
PROBLEM CODE : PARALLEL
*/
#include<stdio.h>
int main()
{
int a,b,steps,n;
{
int a,b,steps,n;
scanf("%d",&n);
for(b=n,steps=0;b;b/=2)
steps++;
steps=(steps-1)*2;
printf("%d\n",steps);
for(b=n,steps=0;b;b/=2)
steps++;
steps=(steps-1)*2;
printf("%d\n",steps);
for(b=2;b<=n;b*=2)
{
printf("%d",n/b);
for(a=b;a<=n;a+=b)
printf(" %d+%d=%d",a-b/2,a,a);
printf("\n");
}
{
printf("%d",n/b);
for(a=b;a<=n;a+=b)
printf(" %d+%d=%d",a-b/2,a,a);
printf("\n");
}
for(b/=2;b>=2;b/=2)
{
printf("%d",(n-b/2)/b);
for(a=b+b/2;a<=n;a+=b)
printf(" %d+%d=%d",a-b/2,a,a);
printf("\n");
}
{
printf("%d",(n-b/2)/b);
for(a=b+b/2;a<=n;a+=b)
printf(" %d+%d=%d",a-b/2,a,a);
printf("\n");
}
return 0;
}
}
0 comments:
Post a Comment