#P8711. [蓝桥杯 2020 省 B1] 整除序列

[蓝桥杯 2020 省 B1] 整除序列

Problem Description

There is a sequence. The first number of the sequence is nn, and each following number is the previous number integer-divided by 22. Please output the terms in this sequence whose values are positive.

Input Format

Input one line containing an integer nn.

Output Format

Output one line containing multiple integers. Adjacent integers should be separated by one space, representing the answer.

20
20 10 5 2 1

Hint

For 80%80\% of the testdata, 1n1091 \le n \le 10^9.

For all testdata, 1n10181 \le n \le 10^{18}.

Lanqiao Cup 2020, first round provincial contest, Group B, Problem F.

Translated by ChatGPT 5