You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
304 B
23 lines
304 B
#include <stdio.h>
|
|
|
|
int main()
|
|
{
|
|
int N;
|
|
scanf("%d\n", &N);
|
|
|
|
int m = 0;
|
|
int c = 1;
|
|
do {
|
|
++m;
|
|
c *= 2;
|
|
} while (c*2 <= N);
|
|
|
|
printf("%d\n", m+1);
|
|
printf("1");
|
|
c = 1;
|
|
while (0 < m--) {
|
|
c *= 2;
|
|
printf(" %d", c);
|
|
}
|
|
printf("\n");
|
|
}
|